diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index ee95bce..b8379ad 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -196,3 +196,5 @@ Patch045: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch # Backport potential fix for RH BZ 2257562. Patch046: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch +# Fix build with GCC 14 -Werror=calloc-transposed-args +Patch047: gdb-gcc14-Wcalloc-transposed-args.patch diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index 80df31a..8258dc9 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -44,3 +44,4 @@ %patch -p1 -P044 %patch -p1 -P045 %patch -p1 -P046 +%patch -p1 -P047 diff --git a/gdb-gcc14-Wcalloc-transposed-args.patch b/gdb-gcc14-Wcalloc-transposed-args.patch new file mode 100644 index 0000000..34ec4e3 --- /dev/null +++ b/gdb-gcc14-Wcalloc-transposed-args.patch @@ -0,0 +1,42 @@ +From: Jan-Benedict Glaw +Date: Tue, 21 Nov 2023 16:53:44 +0000 (+0100) +Subject: [opcodes] ARC + PPC: Fix -Walloc-size warnings +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=54195469c18ec9873cc5ba6907f768509473fa9b;hp=790ce1f70c25129b35e060329cdf2915a6def9fd + +[opcodes] ARC + PPC: Fix -Walloc-size warnings + +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. +--- + +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 +- = calloc (sizeof (*arc_infop), 1); ++ = calloc (1, sizeof (*arc_infop)); + + if (arc_infop == 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 = 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;