Bug 1220464

Summary: GCC 14: elfutils package fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Michal Jireš <michal.jires>
Component: DevelopmentAssignee: Michael Matz <matz>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: matz, michal.jires, mjambor
Version: CurrentFlags: matz: needinfo? (michal.jires)
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1220574    

Description Michal Jireš 2024-02-27 14:29:10 UTC
Building elfutils with GCC 14 fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/elfutils/standard/x86_64

Due to:
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


Builds with:

Index: elfutils-0.190/tests/elfstrmerge.c
===================================================================
--- elfutils-0.190.orig/tests/elfstrmerge.c
+++ elfutils-0.190/tests/elfstrmerge.c
@@ -447,7 +447,7 @@ main (int argc, char **argv)
     }

   newshnums = shdrnum - 1;
-  newscnbufs = calloc (sizeof (void *), newshnums);
+  newscnbufs = calloc (newshnums, sizeof (void *));
   if (newscnbufs == NULL)
     fail_errno ("Couldn't allocate memory for new section buffers", NULL);
Comment 1 Michael Matz 2024-02-29 15:23:42 UTC
Please make a submit request with the quoted change.  Thanks.
Comment 2 OBSbugzilla Bot 2024-03-17 19:35:02 UTC
This is an autogenerated message for OBS integration:
This bug (1220464) was mentioned in
https://build.opensuse.org/request/show/1158795 Factory / elfutils
Comment 3 Richard Biener 2024-04-10 06:13:07 UTC
A fix was merged.