Bug 2333039

Summary: 389-ds-base fails to build with GCC 15 (C23 function prototype issue?)
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: abokovoy, jachapma, mreynolds, spichugi, tbordaz, vashirov
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-26 13:25:06 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 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.