Bug 2336274

Summary: alpine fails to build with C23 ("error: conflicting types for 'strcoll'; have 'int(void)'")
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: alpineAssignee: Steve Traylen <steve.traylen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: cheese, joshuadfranklin, paul.wouters, rdieter, steve.traylen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: alpine-2.26-18.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-03-07 14:35:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2333037    

Description Dave Malcolm 2025-01-07 23:40:55 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/8476072/

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

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

I see:

In file included from collate.c:15:
collate.c: In function 'set_collation':
../../include/system.h:94:19: error: conflicting types for 'strcoll'; have 'int(void)'
   94 | # define collator strcoll
      |                   ^~~~~~~
collate.c:29:16: note: in expansion of macro 'collator'
   29 |     extern int collator();  /* set to strcoll if available in system.h */
      |                ^~~~~~~~
In file included from ../../include/system.h:45:
/usr/include/string.h:163:12: note: previous declaration of 'strcoll' with type 'int(const char *, const char *)'
  163 | extern int strcoll (const char *__s1, const char *__s2)
      |            ^~~~~~~
collate.c:31:15: error: assignment to 'int (*)(void)' from incompatible pointer type 'int (*)(char *, char *)' [-Wincompatible-pointer-types]
   31 |     pcollator = strucmp;
      |               ^
collate.c: In function 'sstrcasecmp':
collate.c:79:13: error: too many arguments to function 'pcollator'
   79 |     return((*pcollator)(*(char **)s1, *(char **)s2));
      |            ~^~~~~~~~~~~


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 josef radinger 2025-01-30 10:49:13 UTC
had contact with upstream. he will look into that and maybe publish a new release with fixes, soon.

Comment 2 Aoife Moloney 2025-02-26 13:21:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 3 Steve Traylen 2025-02-27 12:38:47 UTC
Will try the extra compiler flag in a few days time.

Comment 5 Fedora Update System 2025-03-07 14:31:36 UTC
FEDORA-2025-9a9d22d093 (alpine-2.26-18.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-9a9d22d093

Comment 6 Fedora Update System 2025-03-07 14:35:54 UTC
FEDORA-2025-9a9d22d093 (alpine-2.26-18.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.