Skip to content

Commit 4c5a29c

Browse files
committed
Disable -Wdeprecated-non-prototype in the back branches.
There doesn't seem to be any good ABI-preserving way to silence clang 15's -Wdeprecated-non-prototype warnings about our tree-walk APIs. While we've fixed it properly in HEAD, the only way to not see hundreds of these in the back branches is to disable the warnings. We're not going to do anything about them, so we might as well disable them. I noticed that we also get some of these warnings about fmgr.c's support for V0 function call convention, in branches before v10 where we removed that. That's another area we aren't going to change, so turning off the warning seems fine for that too. Per project policy, this is a candidate for back-patching into out-of-support branches: it suppresses annoying compiler warnings but changes no behavior. Hence, back-patch all the way to 9.2. Discussion: https://postgr.es/m/CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com
1 parent 7603087 commit 4c5a29c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

configure

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4929,6 +4929,47 @@ fi
49294929
if test -n "$NOT_THE_CFLAGS"; then
49304930
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
49314931
fi
4932+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
4933+
# tree-walking APIs that we can't reasonably change in the back branches.
4934+
NOT_THE_CFLAGS=""
4935+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeprecated-non-prototype" >&5
4936+
$as_echo_n "checking whether $CC supports -Wdeprecated-non-prototype... " >&6; }
4937+
if ${pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype+:} false; then :
4938+
$as_echo_n "(cached) " >&6
4939+
else
4940+
pgac_save_CFLAGS=$CFLAGS
4941+
CFLAGS="$pgac_save_CFLAGS -Wdeprecated-non-prototype"
4942+
ac_save_c_werror_flag=$ac_c_werror_flag
4943+
ac_c_werror_flag=yes
4944+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4945+
/* end confdefs.h. */
4946+
4947+
int
4948+
main ()
4949+
{
4950+
4951+
;
4952+
return 0;
4953+
}
4954+
_ACEOF
4955+
if ac_fn_c_try_compile "$LINENO"; then :
4956+
pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype=yes
4957+
else
4958+
pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype=no
4959+
fi
4960+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4961+
ac_c_werror_flag=$ac_save_c_werror_flag
4962+
CFLAGS="$pgac_save_CFLAGS"
4963+
fi
4964+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" >&5
4965+
$as_echo "$pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" >&6; }
4966+
if test x"$pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" = x"yes"; then
4967+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
4968+
fi
4969+
4970+
if test -n "$NOT_THE_CFLAGS"; then
4971+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
4972+
fi
49324973
# Similarly disable useless truncation warnings from gcc 8+
49334974
NOT_THE_CFLAGS=""
49344975
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-truncation" >&5

configure.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,13 @@ if test "$GCC" = yes -a "$ICC" = no; then
481481
if test -n "$NOT_THE_CFLAGS"; then
482482
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
483483
fi
484+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
485+
# tree-walking APIs that we can't reasonably change in the back branches.
486+
NOT_THE_CFLAGS=""
487+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
488+
if test -n "$NOT_THE_CFLAGS"; then
489+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
490+
fi
484491
# Similarly disable useless truncation warnings from gcc 8+
485492
NOT_THE_CFLAGS=""
486493
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])

0 commit comments

Comments
 (0)