You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PHP_TEST_BUILD macro false negatives with -Werror=strict-prototypes #13727
The char $1(); runs afoul of -Wstrict-prototypes, so when that warning is turned into an error via CFLAGS, it can cause the build test to fail even if the function/library it's checking for is present.
I found this accidentally while testing ext/gd with -Werror=strict-prototypes in my CFLAGS (from working on an unrelated problem):
$ ./configure --disable-all --enable-gd
...
checking for GD support... yes
checking for external libgd... no
checking for libavif... no
checking for libwebp... no
checking for libjpeg... no
checking for libXpm... no
checking for FreeType 2... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for zlib... yes
checking for libpng... yes
configure: error: GD build test failed. Please check the config.log for details.
conftest.c:225:5: error: function declaration isn't a prototype [-Werror=strict-prototypes]
225 | char foobar();
| ^~~~
For now, "don't do that" is a valid response, but in a few years we'll start seeing newer compilers enable these things by default. The result here is not too bad because the build dies, but in the worst case, features could quietly be disabled.
Activity
Fix GH-13727: macro generating invalid call test prototypes fixes.