From: William Lallemand Date: Tue, 15 Apr 2025 13:49:44 +0000 (+0200) Subject: BUILD: incompatible pointer type suspected with -DDEBUG_UNIT X-Git-Tag: v3.2-dev11~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F20250415-gcc-15-unittest;p=thirdparty%2Fhaproxy.git BUILD: incompatible pointer type suspected with -DDEBUG_UNIT src/jws.c: In function '__jws_init': src/jws.c:594:38: error: passing argument 2 of 'hap_register_unittest' from incompatible pointer type [-Wincompatible-pointer-types] 594 | hap_register_unittest("jwk", jwk_debug); | ^~~~~~~~~ | | | int (*)(int, char **) In file included from include/haproxy/api.h:36, from include/import/ebtree.h:251, from include/import/ebmbtree.h:25, from include/haproxy/jwt-t.h:25, from src/jws.c:5: include/haproxy/init.h:37:52: note: expected 'int (*)(void)' but argument is of type 'int (*)(int, char **)' 37 | void hap_register_unittest(const char *name, int (*fct)()); | ~~~~~~^~~~~~ GCC 15 is warning because the function pointer does have its arguments in the register function. Should fix issue #2929. --- diff --git a/include/haproxy/init.h b/include/haproxy/init.h index 382e7a142..3bf4f0887 100644 --- a/include/haproxy/init.h +++ b/include/haproxy/init.h @@ -34,7 +34,7 @@ void hap_register_per_thread_free(void (*fct)()); #ifdef DEBUG_UNIT -void hap_register_unittest(const char *name, int (*fct)()); +void hap_register_unittest(const char *name, int (*fct)(int, char **)); /* Simplified way to register a unit test */ #define REGISTER_UNITTEST(name, fct) \ INITCALL2(STG_REGISTER, hap_register_unittest, name, (fct))