'-O(?:2|3)',
);
my @def_cflags_format = (
- '-Wformat',
+ '-Wformat(?:=2)?', # -Wformat=2 implies -Wformat, accept it too
'-Werror=format-security', # implies -Wformat-security
);
my @def_cflags_fortify = (
# stores string values of flag regexps above, see compile_flag_regexp().
my %flag_renames = (
'-O(?:2|3)' => '-O2',
+ '-Wformat(?:=2)?' => '-Wformat',
'-Wl,(?:-z,)?relro' => '-Wl,-z,relro',
'-Wl,(?:-z,)?now' => '-Wl,-z,now',
);
printf '%s (%s)%s %s',
error_color($message, 'red'), $flags, error_color(':', 'yellow'),
$line;
+
+ return;
}
sub error_non_verbose_build {
my ($line) = @_;
error_color('NONVERBOSE BUILD', 'red'),
error_color(':', 'yellow'),
$line;
+
+ return;
}
sub error_invalid_cmake {
my ($version) = @_;
error_color('INVALID CMAKE', 'red'),
error_color(':', 'yellow'),
$version;
+
+ return;
}
sub error_hardening_wrapper {
printf "%s%s %s\n",
error_color('HARDENING WRAPPER', 'red'),
error_color(':', 'yellow'),
'no checks possible, aborting';
+
+ return;
}
sub error_color {
my ($message, $color) = @_;
or not exists $removes{$flag_renames_ref->{$_}})
} @{$flags};
}
+
+ return;
}
sub compile_flag_regexp {