diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-10-06 18:16:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-10-13 08:09:17 +0200 |
commit | 8db245dbe48e58e740f3138b49ea051b36e47b08 (patch) | |
tree | 86bc7f8ec4e7ff7ad67f8f3175d85eddc4e845a6 /dist | |
parent | 632ce96a35d784df9e43bc8ad87b4e8f1f24a590 (diff) | |
download | perl-8db245dbe48e58e740f3138b49ea051b36e47b08.tar.gz |
Devel::PPPort shouldn't unconditionally -Wdeclaration-after-statement
Add the flag for gcc for perl v5.34.4 and earlier.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Devel-PPPort/Makefile.PL | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dist/Devel-PPPort/Makefile.PL b/dist/Devel-PPPort/Makefile.PL index 0aa4525a50..63fb8c4d9c 100644 --- a/dist/Devel-PPPort/Makefile.PL +++ b/dist/Devel-PPPort/Makefile.PL @@ -132,7 +132,15 @@ sub configure if ($Config{gccversion}) { my $define = '-W -Wall'; - $define .= ' -Wdeclaration-after-statement' if $Config{gccversion} =~ /^(\d+\.\d+)\./ && $1 >= 3.4; + if ($] < 5.035005 && $Config{gccversion} =~ /^(\d+\.\d+)\./ && $1 >= 3.4) { + # v5.35.5 enables some C99 features including mixed declarations and code, + # and uses them in inline.h, hence we can't enable this warning flag + # without generating false positive warnings. + # Earlier versions of perl support older compilers that are strict C89, + # hence code in ppport.h needs to avoid mixed declarations and code, hence + # enable this warning on earlier perls so that we can still spot problems. + $define .= ' -Wdeclaration-after-statement'; + } push @moreopts, DEFINE => $define; } |