p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
151 stars 95 forks source link

Fails to build with GCC 15 (defaults to -std=gnu23) #664

Open thesamesam opened 6 days ago

thesamesam commented 6 days ago

Upcoming GCC 15 defaults to -std=gnu23. p11-kit-0.25.5 fails to build like:

FAILED: p11-kit/p11-kit.p/export-object.c.o
x86_64-pc-linux-gnu-gcc -m32 -mfpmath=sse -Ip11-kit/p11-kit.p -Ip11-kit -I../p11-kit-0.25.5/p11-kit -I. -I../p11-kit-0.25.5 -Icommon -I../p11-kit-0.25.5/common -I/usr/lib/libffi/include
-flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -D_GNU_SOURCE -DP11_KIT_FUTURE_UNSTABLE_API -O3 -march=native -mtls-dialect=gnu2 -fno-semantic-interposition -pipe -fcf-protection=none -fdiagnostics-color=always -fdiagnostics-urls=never -frecord-gcc-switches -fdiagnostics-details -Wa,-O2 -Wa,-mtune=znver2 -Warray-bounds -Wstrict-aliasing -Wfree-nonheap-object -Wuninitialized -Wmaybe-uninitialized -Wreturn-type -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr -Warray-bounds -fdiagnostics-details -Wstringop-overread -Wstringop-overflow -Wstringop-truncation -Wbuiltin-declaration-mismatch -ggdb3 -Wformat -Werror=format-security '-DBINDIR="/usr/bin"' '-DPRIVATEDIR="/usr/libexec/p11-kit"' '-DSYSCONFDIR="/etc"' '-DP11_SYSTEM_CONFIG_FILE="/etc/pkcs11/pkcs11.conf"' '-DP11_SYSTEM_CONFIG_MODULES="/etc/pkcs11/modules"' '-DP11_PACKAGE_CONFIG_MODULES="/usr/share/p11-kit/modules"' '-DP11_USER_CONFIG_FILE="~/.config/pkcs11/pkcs11.conf"' '-DP11_USER_CONFIG_MODULES="~/.config/pkcs11/modules"' '-DP11_MODULE_PATH="/usr/lib/pkcs11"' -MD -MQ p11-kit/p11-kit.p/export-object.c.o -MF p11-kit/p11-kit.p/export-object.c.o.d -o p11-kit/p11-kit.p/export-object.c.o -c ../p11-kit-0.25.5/p11-kit/export-object.c
In file included from ../p11-kit-0.25.5/p11-kit/export-object.c:43:
../p11-kit-0.25.5/p11-kit/export-object.c: In function ‘export_pubkey_ec’:
../p11-kit-0.25.5/p11-kit/export-object.c:237:36: error: incompatible types when returning type ‘_Bool’ but ‘unsigned char *’ was expected
  237 |         return_val_if_fail (attrs, false);
      |                                    ^~~~~
../p11-kit-0.25.5/common/debug.h:76:21: note: in definition of macro ‘return_val_if_fail’
   76 |              return v; \
      |                     ^