From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1474) id DA91F3858D35; Tue, 21 Nov 2023 16:55:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA91F3858D35 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan-Benedict Glaw To: bfd-cvs@sourceware.org Subject: [binutils-gdb] [opcodes] ARC + PPC: Fix -Walloc-size warnings X-Act-Checkin: binutils-gdb X-Git-Author: Jan-Benedict Glaw X-Git-Refname: refs/heads/master X-Git-Oldrev: 790ce1f70c25129b35e060329cdf2915a6def9fd X-Git-Newrev: 54195469c18ec9873cc5ba6907f768509473fa9b Message-Id: <20231121165519.DA91F3858D35@sourceware.org> Date: Tue, 21 Nov 2023 16:55:19 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2023 16:55:20 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D54195469c18e= c9873cc5ba6907f768509473fa9b commit 54195469c18ec9873cc5ba6907f768509473fa9b Author: Jan-Benedict Glaw Date: Tue Nov 21 17:53:44 2023 +0100 [opcodes] ARC + PPC: Fix -Walloc-size warnings =20 Recently, -Walloc-size warnings started to kick in. Fix these two calloc() calls to match the intended usage pattern. =20 opcodes/ChangeLog: =20 * arc-dis.c (init_arc_disasm_info): Fix calloc() call. * ppc-dis.c (powerpc_init_dialect): Ditto. Diff: --- opcodes/arc-dis.c | 2 +- opcodes/ppc-dis.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index 59b668ff64e..7498e75cee2 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -147,7 +147,7 @@ static bool init_arc_disasm_info (struct disassemble_info *info) { struct arc_disassemble_info *arc_infop - =3D calloc (sizeof (*arc_infop), 1); + =3D calloc (1, sizeof (*arc_infop)); =20 if (arc_infop =3D=3D NULL) return false; diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index d97137d8b71..4d5652ebfeb 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info) { ppc_cpu_t dialect =3D 0; ppc_cpu_t sticky =3D 0; - struct dis_private *priv =3D calloc (sizeof (*priv), 1); + struct dis_private *priv =3D calloc (1, sizeof (*priv)); =20 if (priv =3D=3D NULL) return;