diff options
author | Tony Cook <tony@develop-help.com> | 2019-12-17 11:32:40 +1100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-12-17 14:44:20 -0700 |
commit | da255c79e19b6d6937fe9fe83c3bc7cd7ae8db5f (patch) | |
tree | 4c1ae9ad03963fb756082a37dea2b5ce05e487bf | |
parent | 9f16475a53933d1d9c547f871b97b3b12160cece (diff) | |
download | perl-da255c79e19b6d6937fe9fe83c3bc7cd7ae8db5f.tar.gz |
don't use -Werror=declaration-after-statement with C++
declaration after statement is normal for C++ and C++ compilers
rightly complain if we try to warn (or error) on them, so don't
try to.
fixes #17353
-rwxr-xr-x | cflags.SH | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -178,11 +178,17 @@ Intel*) ;; # # Is that you, Intel C++? # -std=c89 before -ansi # -pedantic* before -Werror=d-a-s # -*) for opt in -std=c89 -ansi $pedantic \ - -Werror=declaration-after-statement \ - -Werror=pointer-arith \ - -Wextra -W \ - -Wc++-compat -Wwrite-strings +*) warns=-std=c89 -ansi $pedantic \ + -Werror=pointer-arith \ + -Wextra -W \ + -Wc++-compat -Wwrite-strings + # declaration after statement is normal in C++ rather than an + # extension and compilers complain if we try to warn about it + case "$d_cplusplus" in + define) ;; + *) warns="$warns -Werror=declaration-after-statement" ;; + esac + for opt in $warns do case " $ccflags " in *" $opt "*) ;; # Skip if already there. |