Skip to content

Commit f9a56e7

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 b7d9b0c commit f9a56e7

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

configure

+87
Original file line numberDiff line numberDiff line change
@@ -6399,6 +6399,51 @@ fi
63996399
if test -n "$NOT_THE_CFLAGS"; then
64006400
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
64016401
fi
6402+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
6403+
# tree-walking APIs that we can't reasonably change in the back branches.
6404+
NOT_THE_CFLAGS=""
6405+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
6406+
$as_echo_n "checking whether ${CC} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
6407+
if ${pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype+:} false; then :
6408+
$as_echo_n "(cached) " >&6
6409+
else
6410+
pgac_save_CFLAGS=$CFLAGS
6411+
pgac_save_CC=$CC
6412+
CC=${CC}
6413+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6414+
ac_save_c_werror_flag=$ac_c_werror_flag
6415+
ac_c_werror_flag=yes
6416+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6417+
/* end confdefs.h. */
6418+
6419+
int
6420+
main ()
6421+
{
6422+
6423+
;
6424+
return 0;
6425+
}
6426+
_ACEOF
6427+
if ac_fn_c_try_compile "$LINENO"; then :
6428+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=yes
6429+
else
6430+
pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype=no
6431+
fi
6432+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6433+
ac_c_werror_flag=$ac_save_c_werror_flag
6434+
CFLAGS="$pgac_save_CFLAGS"
6435+
CC="$pgac_save_CC"
6436+
fi
6437+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&5
6438+
$as_echo "$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" >&6; }
6439+
if test x"$pgac_cv_prog_CC_cflags__Wdeprecated_non_prototype" = x"yes"; then
6440+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
6441+
fi
6442+
6443+
6444+
if test -n "$NOT_THE_CFLAGS"; then
6445+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
6446+
fi
64026447
# Similarly disable useless truncation warnings from gcc 8+
64036448
NOT_THE_CFLAGS=""
64046449
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
@@ -7314,6 +7359,48 @@ fi
73147359
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
73157360
fi
73167361
NOT_THE_CFLAGS=""
7362+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS" >&5
7363+
$as_echo_n "checking whether ${CLANG} supports -Wdeprecated-non-prototype, for NOT_THE_CFLAGS... " >&6; }
7364+
if ${pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype+:} false; then :
7365+
$as_echo_n "(cached) " >&6
7366+
else
7367+
pgac_save_CFLAGS=$CFLAGS
7368+
pgac_save_CC=$CC
7369+
CC=${CLANG}
7370+
CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
7371+
ac_save_c_werror_flag=$ac_c_werror_flag
7372+
ac_c_werror_flag=yes
7373+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7374+
/* end confdefs.h. */
7375+
7376+
int
7377+
main ()
7378+
{
7379+
7380+
;
7381+
return 0;
7382+
}
7383+
_ACEOF
7384+
if ac_fn_c_try_compile "$LINENO"; then :
7385+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=yes
7386+
else
7387+
pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype=no
7388+
fi
7389+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7390+
ac_c_werror_flag=$ac_save_c_werror_flag
7391+
CFLAGS="$pgac_save_CFLAGS"
7392+
CC="$pgac_save_CC"
7393+
fi
7394+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&5
7395+
$as_echo "$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" >&6; }
7396+
if test x"$pgac_cv_prog_CLANG_cflags__Wdeprecated_non_prototype" = x"yes"; then
7397+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
7398+
fi
7399+
7400+
if test -n "$NOT_THE_CFLAGS"; then
7401+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
7402+
fi
7403+
NOT_THE_CFLAGS=""
73177404
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
73187405
$as_echo_n "checking whether ${CLANG} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
73197406
if ${pgac_cv_prog_CLANG_cflags__Wformat_truncation+:} false; then :

configure.ac

+12
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,13 @@ if test "$GCC" = yes -a "$ICC" = no; then
545545
if test -n "$NOT_THE_CFLAGS"; then
546546
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
547547
fi
548+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
549+
# tree-walking APIs that we can't reasonably change in the back branches.
550+
NOT_THE_CFLAGS=""
551+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
552+
if test -n "$NOT_THE_CFLAGS"; then
553+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
554+
fi
548555
# Similarly disable useless truncation warnings from gcc 8+
549556
NOT_THE_CFLAGS=""
550557
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])
@@ -607,6 +614,11 @@ if test "$with_llvm" = yes ; then
607614
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-compound-token-split-by-macro"
608615
fi
609616
NOT_THE_CFLAGS=""
617+
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
618+
if test -n "$NOT_THE_CFLAGS"; then
619+
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-deprecated-non-prototype"
620+
fi
621+
NOT_THE_CFLAGS=""
610622
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wformat-truncation])
611623
if test -n "$NOT_THE_CFLAGS"; then
612624
BITCODE_CFLAGS="$BITCODE_CFLAGS -Wno-format-truncation"

0 commit comments

Comments
 (0)