Only enable -Wstrict-prototypes in CI to unbreak feature detection

Adding `-Wstrict-prototypes` to the default `CFLAGS` in PR #2473 had the
non-obvious side-effect of breaking configure-time feature detection,
because the [test-program `autoconf` generates for feature
detection](https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generating-Sources.html#:~:text=main%20())
defines `main` as:
```c
int main()
```
Which causes all feature checks to fail, since this triggers
`-Wstrict-prototypes` and the feature checks use `-Werror`.

Resolved by only adding `-Wstrict-prototypes` to
`EXTRA_{CFLAGS,CXXFLAGS}` in CI, since these flags are not used during
feature detection and we control which compiler is used.
This commit is contained in:
Kevin Svetlitski 2023-07-06 16:51:51 -07:00 committed by Qi Wang
parent 589c63b424
commit 5711dc31d8
2 changed files with 1 additions and 2 deletions

View File

@ -262,7 +262,6 @@ if test "x$GCC" = "xyes" ; then
dnl This one too.
JE_CFLAGS_ADD([-Wno-missing-field-initializers])
JE_CFLAGS_ADD([-Wno-missing-attributes])
JE_CFLAGS_ADD([-Wstrict-prototypes])
JE_CFLAGS_ADD([-pipe])
JE_CFLAGS_ADD([-g3])
elif test "x$je_cv_msvc" = "xyes" ; then

View File

@ -13,7 +13,7 @@ compile_time_malloc_conf='background_thread:true,'\
'prof_unbias:false,'\
'prof_time_resolution:high'
./autogen.sh \
EXTRA_CFLAGS='-Wstrict-prototypes' EXTRA_CXXFLAGS='-Wstrict-prototypes' ./autogen.sh \
--with-private-namespace=jemalloc_ \
--disable-cache-oblivious \
--enable-prof \