Bug 2336257 - R-stringdist fails to build with GCC 15 / C23 ("stringdist.c:110:5: error: too many arguments to function 'free_dictionary'")
Summary: R-stringdist fails to build with GCC 15 / C23 ("stringdist.c:110:5: error: to...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: R-stringdist
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Elliott Sales de Andrade
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2025-01-07 22:18 UTC by Dave Malcolm
Modified: 2025-01-12 07:34 UTC (History)
2 users (show)

Fixed In Version: R-stringdist-0.9.15-1.fc42
Clone Of:
Environment:
Last Closed: 2025-01-12 07:34:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2025-01-07 22:18:45 UTC
I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide.  See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15

My test build with GCC 15 failed:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476048/

whereas my test build with GCC 14 succeeded:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8477600/

Looking at the failure logs e.g.
https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476048-R-stringdist/builder-live.log.gz

I see:

stringdist.c: In function 'close_stringdist':
stringdist.c:110:5: error: too many arguments to function 'free_dictionary'
  110 |     free_dictionary(S->dict);
      |     ^~~~~~~~~~~~~~~
In file included from stringdist.c:24:
dist.h:11:6: note: declared here
   11 | void free_dictionary();
      |      ^~~~~~~~~~~~~~~
stringdist.c:113:5: error: too many arguments to function 'free_qtree'
  113 |     free_qtree(S->tree);
      |     ^~~~~~~~~~
dist.h:19:6: note: declared here
   19 | void free_qtree();
      |      ^~~~~~~~~~
stringdist.c: In function 'reset_stringdist':
stringdist.c:120:7: error: too many arguments to function 'free_qtree'
  120 |       free_qtree(S->tree);
      |       ^~~~~~~~~~
dist.h:19:6: note: declared here
   19 | void free_qtree();
      |      ^~~~~~~~~~

This is probably due to GCC 15 now defaulting to -std=gnu23, whereas GCC 14 defaulted to -std=gnu17, and C23 is stricter about function prototypes than C17.  It's probably fixable by fixing the function prototypes (or by manually adding -std=gnu17 to the C build flags)


Reproducible: Always

Comment 1 Elliott Sales de Andrade 2025-01-12 07:34:51 UTC
This is fixed by updating to the latest bugfix.


Note You need to log in before you can comment on or make changes to this bug.