berkeley-db: silence warning/error about incompatible pointer types with GCC 15 (#50483)

This commit is contained in:
Mikael Simberg 2025-05-19 20:04:47 +02:00 committed by GitHub
parent a13557ac94
commit 3ea16482a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,6 +75,18 @@ def patch(self):
filter_file(r"bdb-sql", "", "dist/Makefile.in")
filter_file(r"gsg_db_server", "", "dist/Makefile.in")
def flag_handler(self, name, flags):
# GCC 15 defaults to C23 which gives a warning (and by default error)
# about assignment to an incompatible function pointer type
# (https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters):
#
# error: initialization of 'int (*)(void)' from incompatible pointer
# type 'int (*)(DB_ENV *, const char *)' {aka 'int (*)(struct __db_env
# *, const char *)'} [-Wincompatible-pointer-types]
if name == "cflags" and self.spec.satisfies("%[virtuals=c] gcc@15:"):
flags.append("-Wno-error=incompatible-pointer-types")
return (flags, None, None)
def configure_args(self):
spec = self.spec