https://bugs.openldap.org/show_bug.cgi?id=9332
Issue ID: 9332 Summary: Compilation of 2.4.52 fails: "init.c", line 45: too many initializers for scalar Product: OpenLDAP Version: 2.4.52 Hardware: All OS: Solaris Status: UNCONFIRMED Severity: normal Priority: --- Component: build Assignee: bugs@openldap.org Reporter: stacey.marshall@gmail.com Target Milestone: ---
The addition of integer ldo_tls_require_san to structure requires an additional initialization digit to macro LDAP_LDO_TLS_NULLARG.
--- openldap-2.4.52/libraries/libldap/ldap-int.h 2020-08-28 09:10:00.000000000 -0700 +++ openldap-2.4.52.x/libraries/libldap/ldap-int.h 2020-09-01 10:08:44.661226154 -0700 @@ -263,7 +263,7 @@ int ldo_tls_impl; int ldo_tls_crlcheck; int ldo_tls_require_san; -#define LDAP_LDO_TLS_NULLARG ,0,0,0,{0,0,0,0,0,0,0,0,0},0,0,0,0 +#define LDAP_LDO_TLS_NULLARG ,0,0,0,{0,0,0,0,0,0,0,0,0},0,0,0,0,0 #else #define LDAP_LDO_TLS_NULLARG #endif
https://bugs.openldap.org/show_bug.cgi?id=9332
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to stacey.marshall from comment #0)
The addition of integer ldo_tls_require_san to structure requires an additional initialization digit to macro LDAP_LDO_TLS_NULLARG.
Sounds like a broken compiler, especially if it's spitting out the error message stated in this ticket title. (I.e., if it was correct it should be complaining about too few initializers.) But even so, the C standard already says that any unspecified initializaers default to zero, so it's not even necessary to provide these.
What compiler/version did you use?
--- openldap-2.4.52/libraries/libldap/ldap-int.h 2020-08-28 09:10:00.000000000 -0700 +++ openldap-2.4.52.x/libraries/libldap/ldap-int.h 2020-09-01 10:08:44.661226154 -0700 @@ -263,7 +263,7 @@ int ldo_tls_impl; int ldo_tls_crlcheck; int ldo_tls_require_san; -#define LDAP_LDO_TLS_NULLARG ,0,0,0,{0,0,0,0,0,0,0,0,0},0,0,0,0 +#define LDAP_LDO_TLS_NULLARG ,0,0,0,{0,0,0,0,0,0,0,0,0},0,0,0,0,0 #else #define LDAP_LDO_TLS_NULLARG #endif
https://bugs.openldap.org/show_bug.cgi?id=9332
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.4.53 Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- trunk:
Commits: • 4c74bd0a by Howard Chu at 2020-09-01T20:25:00+01:00 ITS#9332 add placeholder in LDAP_LDO_TLS_NULLARG
RE24:
Commits: • 5f2b1e0b by Howard Chu at 2020-09-01T20:21:22+01:00 ITS#9332 add placeholder in LDAP_LDO_TLS_NULLARG
https://bugs.openldap.org/show_bug.cgi?id=9332
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED
https://bugs.openldap.org/show_bug.cgi?id=9332
--- Comment #3 from stacey.marshall@gmail.com --- Thanks Howard, it is an odd error message!
The compiler being used is
/opt/solarisstudio12.4/bin/cc -V cc: Sun C 5.13 SunOS_i386 Patch 151633-10 2020/04/08
I have tried with later version too.
/opt/developerstudio12.6/bin/cc -V cc: Studio 12.6 Sun C 5.15 SunOS_i386 152882-05 2019/10/30
I shall open a bug against the compiler.
Regards, Stacey
https://bugs.openldap.org/show_bug.cgi?id=9332
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=9332
--- Comment #4 from Jordan Brown openldap@jordan.maileater.net --- This is not a compiler problem at all.
The missing entry in LDAP_LDO_TLS_NULLARG causes all subsequent initializers to be misaligned with the structure members, eventually leading to an attempt to initialize a scalar structure member with a brace-enclosed list of initializers.
The exact circumstances will vary depending on compilation options and system-supplied macro values. In this case, I believe that one of the members in ldo_sasl_secprops ends up matched with a brace-enclosed initializer from LDAP_LDO_MUTEX_NULLARG intended for ldo_mutex.
https://bugs.openldap.org/show_bug.cgi?id=9332
--- Comment #5 from Howard Chu hyc@openldap.org --- (In reply to Jordan Brown from comment #4)
This is not a compiler problem at all.
Why are you replying to an issue that was fixed and closed months ago?
https://bugs.openldap.org/show_bug.cgi?id=9332#c2