8000 Disable -Wdeprecated-non-prototype in the back branches. · postgres/postgres@9afdf39 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9afdf39

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 6ae8aee commit 9afdf39

File tree

2 files changed

+99
-0
lines changed
< 8000 span class="prc-TooltipV2-Tooltip-cYMVY" data-direction="s" aria-hidden="true" id=":R3t5dab:">Filter options

2 files changed

+99
-0
lines changed

configure

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,6 +5874,51 @@ fi
58745874
if test -n "$NOT_THE_CFLAGS"; then
58755875
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
58765876
fi
5877+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
5878+
# tree-walking APIs that we can't reasonably change in the back branches.
5879+
NOT_THE_CFLAGS=""
5880+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
5881+
$as_echo_n "checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
5882+
if ${pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype+:} false; then :
5883+
$as_echo_n "(cached) " >&6
5884+
else
5885+
pgac_save_CFLAGS=$CFLAGS
5886+
pgac_save_CC=$CC
5887+
CC=${CC}
5888+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
5889+
ac_save_c_werror_flag=$ac_c_werror_flag
5890+
ac_c_werror_flag=yes
5891+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5892+
/* end confdefs.h. */
5893+
5894+
int
5895+
main ()
5896+
{
5897+
5898+
;
5899+
return 0;
5900+
}
5901+
_ACEOF
5902+
if ac_fn_c_try_compile "$LINENO"; then :
5903+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=yes
5904+
else
5905+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=no
5906+
fi
5907+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5908+
ac_c_werror_flag=$ac_save_c_werror_flag
5909+
CFLAGS="$pgac_save_CFLAGS"
5910+
CC="$pgac_save_CC"
5911+
fi
5912+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&5
5913+
$as_echo "$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&6; }
5914+
if test x"$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" = x"yes"; then
5915+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
5916+
fi
5917+
5918+
5919+
if test -n "$NOT_THE_CFLAGS"; then
5920+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
5921+
fi
58775922
# Similarly disable useless truncation warnings from gcc 8+
58785923
NOT_THE_CFLAGS=""
58795924
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
@@ -6788,6 +6833,48 @@ fi
67886833
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
67896834
fi
67906835
NOT_THE_CFLAGS=""
6836+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
6837+
$as_echo_n "checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
6838+
if ${pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype+:} false; then :
6839+
$as_echo_n "(cached) " >&6
6840+
else
6841+
pgac_save_CFLAGS=$CFLAGS
6842+
pgac_save_CC=$CC
6843+
CC=${CLANG}
6844+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6845+
ac_save_c_werror_flag=$ac_c_werror_flag
6846+
ac_c_werror_flag=yes
6847+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6848+
/* end confdefs.h. */
6849+
6850+
int
6851+
main ()
6852+
{
6853+
6854+
;
6855+
return 0;
6856+
}
6857+
_ACEOF
6858+
if ac_fn_c_try_compile "$LINENO"; then :
6859+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=yes
6860+
else
6861+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=no
6862+
fi
6863+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6864+
ac_c_werror_flag=$ac_save_c_werror_flag
6865+
CFLAGS="$pgac_save_CFLAGS"
6866+
CC="$pgac_save_CC"
6867+
fi
6868+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&5
6869+
$as_echo "$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&6; }
6870+
if test x"$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" = x"yes"; then
6871+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6872+
fi
6873+
6874+
if test -n "$NOT_THE_CFLAGS"; then
6875+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
6876+
fi
6877+
NOT_THE_CFLAGS=""
67916878
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
67926879
$as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
67936880
if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :

configure.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,13 @@ if test "$GCC" = yes -a "$ICC" = no; then
516516
if test -n "$NOT_THE_CFLAGS"; then
517517
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
518518
fi
519+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
520+
# tree-walking APIs that we can't reasonably change in the back branches.
521+
NOT_THE_CFLAGS=""
522+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
523+
if test -n "$NOT_THE_CFLAGS"; then
524+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
525+
fi
519526
# Similarly disable useless truncation warnings from gcc 8+
520527
NOT_THE_CFLAGS=""
521528
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])
@@ -577,6 +584,11 @@ if test "$with_llvm" = yes ; then
577584
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
578585
fi
579586
NOT_THE_CFLAGS=""
587+
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
588+
if test -n "$NOT_THE_CFLAGS"; then
589+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
590+
fi
591+
NOT_THE_CFLAGS=""
580592
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wformat-truncation])
581593
if test -n "$NOT_THE_CFLAGS"; then
582594
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"

0 commit comments

Comments
 (0)
0