]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[opcodes] ARC + PPC: Fix -Walloc-size warnings
authorJan-Benedict Glaw <jbglaw@lug-owl.de>
Tue, 21 Nov 2023 16:53:44 +0000 (17:53 +0100)
committerJan-Benedict Glaw <jbglaw@lug-owl.de>
Tue, 21 Nov 2023 16:54:49 +0000 (17:54 +0100)
Recently, -Walloc-size warnings started to kick in. Fix these two
calloc() calls to match the intended usage pattern.

opcodes/ChangeLog:

* arc-dis.c (init_arc_disasm_info): Fix calloc() call.
* ppc-dis.c (powerpc_init_dialect): Ditto.

opcodes/arc-dis.c
opcodes/ppc-dis.c

index 59b668ff64e0df65d38979ec29beb573ee7b5c11..7498e75cee2069ed46bb9e014825850295f25e77 100644 (file)
@@ -147,7 +147,7 @@ static bool
 init_arc_disasm_info (struct disassemble_info *info)
 {
   struct arc_disassemble_info *arc_infop
-    = calloc (sizeof (*arc_infop), 1);
+    = calloc (1, sizeof (*arc_infop));
 
   if (arc_infop == NULL)
     return false;
index d97137d8b71837b74875e44dc935753092838dbc..4d5652ebfebd957fea0185714f95eb55e06657d3 100644 (file)
@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info)
 {
   ppc_cpu_t dialect = 0;
   ppc_cpu_t sticky = 0;
-  struct dis_private *priv = calloc (sizeof (*priv), 1);
+  struct dis_private *priv = calloc (1, sizeof (*priv));
 
   if (priv == NULL)
     return;