Bug 2333039 - 389-ds-base fails to build with GCC 15 (C23 function prototype issue?)
Summary: 389-ds-base fails to build with GCC 15 (C23 function prototype issue?)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: 389-ds-base
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: mreynolds
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2024-12-18 16:16 UTC by Dave Malcolm
Modified: 2025-02-26 13:25 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-26 13:25:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 118112 0 P3 NEW Unhelpful "too many arguments to function" error message (especially w/ C23) 2025-01-06 09:00:07 UTC
Github 389ds 389-ds-base issues 6476 0 None open FTBFS with GCC 15 2025-01-06 15:00:45 UTC

Description Dave Malcolm 2024-12-18 16:16:51 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

In https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3/fedora-rawhide-x86_64/08410915-389-ds-base/builder-live.log.gz

I see this failure:

ldap/servers/slapd/compare.c: In function 'do_compare':
ldap/servers/slapd/compare.c:184:19: error: too many arguments to function 'be->be_database->plg_un.plg_un_db.plg_un_db_compare'
  184 |             rc = (*be->be_compare)(pb);
      |                  ~^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:10278: ldap/servers/slapd/ns_slapd-compare.o] Error 1

whereas the build succeeded with gcc 14.

Looking at the source I see:

slap.h:1467:#define be_compare be_database->plg_compare
    struct slapdplugin *be_database; /* single plugin */
#define plg_compare plg_un.plg_un_db.plg_un_db_compare

slap.h:1074:            IFP plg_un_db_compare;              /* compare */

where slapi-private.h has:

/* JCMREPL - IFP and CFP should be defined centrally */
#ifndef _IFP
#define _IFP
typedef int (*IFP)(); /* takes undefined arguments */
#endif

This is probably due to GCC 15 defaulting to -std=gnu23, whereas GCC 14 defaulted to -std=gnu17, and C23 is stricter about function prototypes than C17.


Reproducible: Always

Comment 1 Dave Malcolm 2024-12-18 16:25:55 UTC
Might be fixable by adding -std=gnu17 to CFLAGS, but ideally the upstream code would be fixed.

The error message could be more helpful; I've filed that with upstream GCC as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118112

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

Comment 3 Viktor Ashirov 2025-02-26 13:25:06 UTC
This is fixed upstream, will be available in the next release.


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