Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ff47ea

Browse files
committed
Clean up compilation warnings coming from PL/Perl with clang-12~
clang-12 has introduced -Wcompound-token-split-by-macro, that is causinga large amount of warnings when building PL/Perl because of itsinteractions with upstream Perl. This commit adds one -Wno to CFLAGS at./configure time if the flag is supported by the compiler to silence allthose warnings.Upstream perl has fixed this issue, but it is going to take some timebefore this is spread across the buildfarm, and we have noticed thatsome animals would be useful with an extra -Werror to help with thedetection of incorrect placeholders (seeb0cf544), dangomushi beingone.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/YYr3qYa/R3Gw+Sbg@paquier.xyzBackpatch-through: 10
1 parentc3b3369 commit9ff47ea

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

‎configure

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6334,6 +6334,52 @@ fi
63346334
if test -n "$NOT_THE_CFLAGS"; then
63356335
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
63366336
fi
6337+
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
6338+
# of warnings when building plperl because of Perl. Like previously, test
6339+
# for the positive form and add the negative form
6340+
NOT_THE_CFLAGS=""
6341+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS" >&5
6342+
$as_echo_n "checking whether ${CC} supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... " >&6; }
6343+
if ${pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro+:} false; then :
6344+
$as_echo_n "(cached) " >&6
6345+
else
6346+
pgac_save_CFLAGS=$CFLAGS
6347+
pgac_save_CC=$CC
6348+
CC=${CC}
6349+
CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6350+
ac_save_c_werror_flag=$ac_c_werror_flag
6351+
ac_c_werror_flag=yes
6352+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6353+
/* end confdefs.h. */
6354+
6355+
int
6356+
main ()
6357+
{
6358+
6359+
;
6360+
return 0;
6361+
}
6362+
_ACEOF
6363+
if ac_fn_c_try_compile "$LINENO"; then :
6364+
pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro=yes
6365+
else
6366+
pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro=no
6367+
fi
6368+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6369+
ac_c_werror_flag=$ac_save_c_werror_flag
6370+
CFLAGS="$pgac_save_CFLAGS"
6371+
CC="$pgac_save_CC"
6372+
fi
6373+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro" >&5
6374+
$as_echo "$pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro" >&6; }
6375+
if test x"$pgac_cv_prog_CC_cflags__Wcompound_token_split_by_macro" = x"yes"; then
6376+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
6377+
fi
6378+
6379+
6380+
if test -n "$NOT_THE_CFLAGS"; then
6381+
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
6382+
fi
63376383
# Similarly disable useless truncation warnings from gcc 8+
63386384
NOT_THE_CFLAGS=""
63396385
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5

‎configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,14 @@ if test "$GCC" = yes -a "$ICC" = no; then
530530
if test -n "$NOT_THE_CFLAGS"; then
531531
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
532532
fi
533+
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
534+
# of warnings when building plperl because of Perl. Like previously, test
535+
# for the positive form and add the negative form
536+
NOT_THE_CFLAGS=""
537+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS,[-Wcompound-token-split-by-macro])
538+
if test -n "$NOT_THE_CFLAGS"; then
539+
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
540+
fi
533541
# Similarly disable useless truncation warnings from gcc 8+
534542
NOT_THE_CFLAGS=""
535543
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS,[-Wformat-truncation])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp