Skip to content

Commit 5d3ce0d

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 6f9ea6c commit 5d3ce0d

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

configure

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,6 +4541,72 @@ fi
45414541
if test -n "$NOT_THE_CFLAGS"; then
45424542
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
45434543
fi
4544+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
4545+
# tree-walking APIs that we can't reasonably change in the back branches.
4546+
NOT_THE_CFLAGS=""
4547+
{ $as_echo "$as_me:$LINENO: checking whether $CC supports -Wdeprecated-non-prototype" >&5
4548+
$as_echo_n "checking whether $CC supports -Wdeprecated-non-prototype... " >&6; }
4549+
if test "${pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype+set}" = set; then
4550+
$as_echo_n "(cached) " >&6
4551+
else
4552+
pgac_save_CFLAGS=$CFLAGS
4553+
CFLAGS="$pgac_save_CFLAGS -Wdeprecated-non-prototype"
4554+
ac_save_c_werror_flag=$ac_c_werror_flag
4555+
ac_c_werror_flag=yes
4556+
cat >conftest.$ac_ext <<_ACEOF
4557+
/* confdefs.h. */
4558+
_ACEOF
4559+
cat confdefs.h >>conftest.$ac_ext
4560+
cat >>conftest.$ac_ext <<_ACEOF
4561+
/* end confdefs.h. */
4562+
4563+
int
4564+
main ()
4565+
{
4566+
4567+
;
4568+
return 0;
4569+
}
4570+
_ACEOF
4571+
rm -f conftest.$ac_objext
4572+
if { (ac_try="$ac_compile"
4573+
case "(($ac_try" in
4574+
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4575+
*) ac_try_echo=$ac_try;;
4576+
esac
4577+
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4578+
$as_echo "$ac_try_echo") >&5
4579+
(eval "$ac_compile") 2>conftest.er1
4580+
ac_status=$?
4581+
grep -v '^ *+' conftest.er1 >conftest.err
4582+
rm -f conftest.er1
4583+
cat conftest.err >&5
4584+
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4585+
(exit $ac_status); } && {
4586+
test -z "$ac_c_werror_flag" ||
4587+
test ! -s conftest.err
4588+
} && test -s conftest.$ac_objext; then
4589+
pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype=yes
4590+
else
4591+
$as_echo "$as_me: failed program was:" >&5
4592+
sed 's/^/| /' conftest.$ac_ext >&5
4593+
4594+
pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype=no
4595+
fi
4596+
4597+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4598+
ac_c_werror_flag=$ac_save_c_werror_flag
4599+
CFLAGS="$pgac_save_CFLAGS"
4600+
fi
4601+
{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" >&5
4602+
$as_echo "$pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" >&6; }
4603+
if test x"$pgac_cv_prog_cc_cflags__Wdeprecated_non_prototype" = x"yes"; then
4604+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wdeprecated-non-prototype"
4605+
fi
4606+
4607+
if test -n "$NOT_THE_CFLAGS"; then
4608+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
4609+
fi
45444610
# Similarly disable useless truncation warnings from gcc 8+
45454611
NOT_THE_CFLAGS=""
45464612
{ $as_echo "$as_me:$LINENO: checking whether $CC supports -Wformat-truncation" >&5

configure.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,13 @@ if test "$GCC" = yes -a "$ICC" = no; then
442442
if test -n "$NOT_THE_CFLAGS"; then
443443
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
444444
fi
445+
# Similarly remove clang 15+'s deprecated-non-prototype, as it warns about
446+
# tree-walking APIs that we can't reasonably change in the back branches.
447+
NOT_THE_CFLAGS=""
448+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wdeprecated-non-prototype])
449+
if test -n "$NOT_THE_CFLAGS"; then
450+
CFLAGS="$CFLAGS -Wno-deprecated-non-prototype"
451+
fi
445452
# Similarly disable useless truncation warnings from gcc 8+
446453
NOT_THE_CFLAGS=""
447454
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy