Skip to content

Commit dcd7dbe

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 2e124d8 commit dcd7dbe

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

configure

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6384,6 +6384,51 @@ fi
63846384
if test -n "$NOT_THE_CFLAGS"; then
63856385
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
63866386
fi
6387+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
6388+
# tree-walking APIs that we can't reasonably change in the back branches.
6389+
NOT_THE_CFLAGS=""
6390+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
6391+
$as_echo_n "checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
6392+
if ${pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype+:} false; then :
6393+
$as_echo_n "(cached) " >&6
6394+
else
6395+
pgac_save_CFLAGS=$CFLAGS
6396+
pgac_save_CC=$CC
6397+
CC=${CC}
6398+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6399+
ac_save_c_werror_flag=$ac_c_werror_flag
6400+
ac_c_werror_flag=yes
6401+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6402+
/* end confdefs.h. */
6403+
6404+
int
6405+
main ()
6406+
{
6407+
6408+
;
6409+
return 0;
6410+
}
6411+
_ACEOF
6412+
if ac_fn_c_try_compile "$LINENO"; then :
6413+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=yes
6414+
else
6415+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=no
6416+
fi
6417+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6418+
ac_c_werror_flag=$ac_save_c_werror_flag
6419+
CFLAGS="$pgac_save_CFLAGS"
6420+
CC="$pgac_save_CC"
6421+
fi
6422+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&5
6423+
$as_echo "$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&6; }
6424+
if test x"$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" = x"yes"; then
6425+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6426+
fi
6427+
6428+
6429+
if test -n "$NOT_THE_CFLAGS"; then
6430+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
6431+
fi
63876432
# Similarly disable useless truncation warnings from gcc 8+
63886433
NOT_THE_CFLAGS=""
63896434
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
@@ -7299,6 +7344,48 @@ fi
72997344
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
73007345
fi
73017346
NOT_THE_CFLAGS=""
7347+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
7348+
$as_echo_n "checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
7349+
if ${pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype+:} false; then :
7350+
$as_echo_n "(cached) " >&6
7351+
else
7352+
pgac_save_CFLAGS=$CFLAGS
7353+
pgac_save_CC=$CC
7354+
CC=${CLANG}
7355+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
7356+
ac_save_c_werror_flag=$ac_c_werror_flag
7357+
ac_c_werror_flag=yes
7358+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7359+
/* end confdefs.h. */
7360+
7361+
int
7362+
main ()
7363+
{
7364+
7365+
;
7366+
return 0;
7367+
}
7368+
_ACEOF
7369+
if ac_fn_c_try_compile "$LINENO"; then :
7370+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=yes
7371+
else
7372+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=no
7373+
fi
7374+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7375+
ac_c_werror_flag=$ac_save_c_werror_flag
7376+
CFLAGS="$pgac_save_CFLAGS"
7377+
CC="$pgac_save_CC"
7378+
fi
7379+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&5
7380+
$as_echo "$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&6; }
7381+
if test x"$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" = x"yes"; then
7382+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
7383+
fi
7384+
7385+
if test -n "$NOT_THE_CFLAGS"; then
7386+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
7387+
fi
7388+
NOT_THE_CFLAGS=""
73027389
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
73037390
$as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
73047391
if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :

configure.ac

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,13 @@ if test "$GCC" = yes -a "$ICC" = no; then
542542
if test -n "$NOT_THE_CFLAGS"; then
543543
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
544544
fi
545+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
546+
# tree-walking APIs that we can't reasonably change in the back branches.
547+
NOT_THE_CFLAGS=""
548+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
549+
if test -n "$NOT_THE_CFLAGS"; then
550+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
551+
fi
545552
# Similarly disable useless truncation warnings from gcc 8+
546553
NOT_THE_CFLAGS=""
547554
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])
@@ -604,6 +611,11 @@ if test "$with_llvm" = yes ; then
604611
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
605612
fi
606613
NOT_THE_CFLAGS=""
614+
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
615+
if test -n "$NOT_THE_CFLAGS"; then
616+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
617+
fi
618+
NOT_THE_CFLAGS=""
607619
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wformat-truncation])
608620
if test -n "$NOT_THE_CFLAGS"; then
609621
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"

0 commit comments

Comments
 (0)