Skip to content

Commit

Permalink
Merge pull request #114 from rurban/gh113-gccwarn
Browse files Browse the repository at this point in the history
fix gcc warnings for older gcc < 4.0
  • Loading branch information
dankogai authored Jun 19, 2017
2 parents 01856e9 + f27775c commit 1d2c1a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ $ENV{PERL_CORE} ||= $ARGV{PERL_CORE} if $ARGV{PERL_CORE};
# similar strictness as in core
my $ccflags = $Config{ccflags};
if (!$ENV{PERL_CORE}) {
if ($Config{gccversion}) {
$ccflags .= ' -Werror=declaration-after-statement';
$ccflags .= ' -Wpointer-sign' unless $Config{d_cplusplus};
if (my $gccver = $Config{gccversion}) {
$gccver =~ s/\.//g;
$gccver .= "0" while length $gccver < 3;
$ccflags .= ' -Werror=declaration-after-statement' if $gccver > 400;
$ccflags .= ' -Wpointer-sign' if !$Config{d_cplusplus} and $gccver > 400;
$ccflags .= ' -fpermissive' if $Config{d_cplusplus};
}
}
Expand Down

0 comments on commit 1d2c1a2

Please sign in to comment.