Comment 4 for bug 2052578

Revision history for this message
Chris Peterson (cpete) wrote :

Hi Sergio,

Thanks for your feedback. I agree that simply reordering the header order in bdb_layer.c would be the best approach.

Originally, I had an issue where by simply moving the standard library header includes below the "bdb_layer.h" include (which should mean the define logic should be reached before any of the standard library headers are included) the project failed to compile with a cryptic error:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -DRUST_ENABLE -DBUILD_NUM=\"2024.038.2016\" "-DVENDOR=\"389 Project\"" -DBRAND=\"389\" -DCAPBRAND=\"389\" -UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT -I./ldap/include -I./ldap/servers/slapd -I./include -I. -DLOCALSTATEDIR=\"/var\" -DSYSCONFDIR=\"/etc\" -DLIBDIR=\"/usr/lib/x86_64-linux-gnu\" -DBINDIR=\"/usr/bin\" -DDATADIR=\"/usr/share\" -DDOCDIR=\"/usr/share/doc/389-ds-base\" -DSBINDIR=\"/usr/sbin\" -DPLUGINDIR=\"/usr/lib/x86_64-linux-gnu/dirsrv/plugins\" -DTEMPLATEDIR=\"/usr/share/dirsrv/data\" -DSYSTEMSCHEMADIR=\"/usr/share/dirsrv/schema\" -DLOCALRUNDIR=\"/run\" -DWITH_SYSTEMD -I/usr/include -I/usr/include/nss -I/usr/include/nspr -I/usr/include/nspr -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=3 -g -O2 -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/389-ds-base-2.4.4+dfsg1-1ubuntu1 -c ldap/servers/slapd/back-ldbm/db-bdb/bdb_ldif2db.c -fPIC -DPIC -o ldap/servers/slapd/back-ldbm/db-bdb/.libs/libback_ldbm_la-bdb_ldif2db.o
In file included from ldap/servers/slapd/back-ldbm/db-bdb/../back-ldbm.h:78,
                 from ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.h:10,
                 from ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c:13:
./ldap/servers/slapd/slap.h:544:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
  544 | #define f_type f_un.f_un_type
      | ^
./ldap/servers/slapd/slap.h:544:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
  544 | #define f_type f_un.f_un_type

but in the process of writing my response I've double checked my work and narrowed down the issue to requiring <sys/statvfs.h> be included in "ldap/servers/slapd/slap.h" for the code to compile correctly.