Bug 2336274 - alpine fails to build with C23 ("error: conflicting types for 'strcoll'; have 'int(void)'")
Summary: alpine fails to build with C23 ("error: conflicting types for 'strcoll'; have...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: alpine
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steve Traylen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2025-01-07 23:40 UTC by Dave Malcolm
Modified: 2025-03-07 14:35 UTC (History)
5 users (show)

Fixed In Version: alpine-2.26-18.fc43
Clone Of:
Environment:
Last Closed: 2025-03-07 14:35:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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