Skip to content

Commit

Permalink
fix gcc warnings for older gcc < 4.0
Browse files Browse the repository at this point in the history
Closes #113
  • Loading branch information
rurban committed Jun 19, 2017
1 parent 01856e9 commit f27775c
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 f27775c

Please sign in to comment.