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

Commite51e8fb

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.This back-patches commit9ff47ea into out-of-support branches,pursuant to newly-established project policy. The point is tosuppress scary-looking warnings so that people building thesebranches needn't expend brain cells verifying that it's safeto ignore the warnings.Discussion:https://postgr.es/m/d0316012-ece7-7b7e-2d36-9c38cb77cb3b@enterprisedb.com
1 parent202c587 commite51e8fb

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

‎configure

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4775,6 +4775,48 @@ fi
47754775
iftest -n"$NOT_THE_CFLAGS";then
47764776
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
47774777
fi
4778+
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
4779+
# of warnings when building plperl because of Perl. Like previously, test
4780+
# for the positive form and add the negative form
4781+
NOT_THE_CFLAGS=""
4782+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking whether$CC supports -Wcompound-token-split-by-macro">&5
4783+
$as_echo_n"checking whether$CC supports -Wcompound-token-split-by-macro...">&6; }
4784+
if${pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro+:}false;then:
4785+
$as_echo_n"(cached)">&6
4786+
else
4787+
pgac_save_CFLAGS=$CFLAGS
4788+
CFLAGS="$pgac_save_CFLAGS -Wcompound-token-split-by-macro"
4789+
ac_save_c_werror_flag=$ac_c_werror_flag
4790+
ac_c_werror_flag=yes
4791+
cat confdefs.h -<<_ACEOF >conftest.$ac_ext
4792+
/* end confdefs.h. */
4793+
4794+
int
4795+
main ()
4796+
{
4797+
4798+
;
4799+
return 0;
4800+
}
4801+
_ACEOF
4802+
if ac_fn_c_try_compile"$LINENO";then:
4803+
pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro=yes
4804+
else
4805+
pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro=no
4806+
fi
4807+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4808+
ac_c_werror_flag=$ac_save_c_werror_flag
4809+
CFLAGS="$pgac_save_CFLAGS"
4810+
fi
4811+
{$as_echo"$as_me:${as_lineno-$LINENO}: result:$pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro">&5
4812+
$as_echo"$pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro">&6; }
4813+
iftest x"$pgac_cv_prog_cc_cflags__Wcompound_token_split_by_macro" = x"yes";then
4814+
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcompound-token-split-by-macro"
4815+
fi
4816+
4817+
iftest -n"$NOT_THE_CFLAGS";then
4818+
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
4819+
fi
47784820
# Similarly disable useless truncation warnings from gcc 8+
47794821
NOT_THE_CFLAGS=""
47804822
{$as_echo"$as_me:${as_lineno-$LINENO}: checking whether$CC supports -Wformat-truncation">&5

‎configure.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,14 @@ if test "$GCC" = yes -a "$ICC" = no; then
453453
if test -n "$NOT_THE_CFLAGS"; then
454454
CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
455455
fi
456+
# Remove clang 12+'s compound-token-split-by-macro, as this causes a lot
457+
# of warnings when building plperl because of Perl. Like previously, test
458+
# for the positive form and add the negative form
459+
NOT_THE_CFLAGS=""
460+
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wcompound-token-split-by-macro])
461+
if test -n "$NOT_THE_CFLAGS"; then
462+
CFLAGS="$CFLAGS -Wno-compound-token-split-by-macro"
463+
fi
456464
# Similarly disable useless truncation warnings from gcc 8+
457465
NOT_THE_CFLAGS=""
458466
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp