Bug 31287 - 0.190: test suite build fails with gcc 14.x
Summary: 0.190: test suite build fails with gcc 14.x
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-24 08:00 UTC by kloczek
Modified: 2024-01-31 16:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kloczek 2024-01-24 08:00:24 UTC
Looks like 0.190 test suite is not gcc 14.x ready

/usr/bin/gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/share/locale"' -I. -I..  -I. -I. -I../lib -I.. -I../libasm -I../libdw -I../libdwfl -I../libdwelf -I../libebl -I../libelf -I../lib -I..  -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Wuse-after-free=3 -Werror -Wunused -Wextra -Wstack-usage=262144   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Wformat -Wno-error=stack-usage= -c -o elfstrmerge.o elfstrmerge.c
elfstrmerge.c: In function ‘main’:
elfstrmerge.c:450:32: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  450 |   newscnbufs = calloc (sizeof (void *), newshnums);
      |                                ^~~~
elfstrmerge.c:450:32: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors
Comment 1 Sam James 2024-01-24 08:20:30 UTC
Fixed in https://sourceware.org/git/?p=elfutils.git;a=commit;h=ae580d48278b9924da7503886b37be34378e1b04, just needs a new release before 14 is out (or we get mjw to change his mind on werror for releases finally :p)
Comment 2 Mark Wielaard 2024-01-31 16:09:07 UTC
commit ae580d48278b9924da7503886b37be34378e1b04
Author: Sergei Trofimovich <slyich@gmail.com>
Date:   Thu Dec 21 09:23:30 2023 +0000

    tests: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)
    
    `gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
    detected minor infelicity in `calloc()` API usage in `elfutils`:
    
        elfstrmerge.c: In function 'main':
        elfstrmerge.c:450:32: error:
          'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
          450 |   newscnbufs = calloc (sizeof (void *), newshnums);
              |                                ^~~~
        elfstrmerge.c:450:32: note: earlier argument should specify number of elements, later size of each element
    
    Signed-off-by: Sergei Trofimovich <slyich@gmail.com>