(?:[a-z0-9_]+-(?:linux-|kfreebsd-)?gnu(?:eabi|eabihf)?-)?
$cc_regex
/x;
+# Regex to check if a line contains a compiler command.
+my $cc_regex_normal = qr/
+ \b$cc_regex(?:\s|\\)
+ /x;
# Regex to catch (GCC) compiler warnings.
my $warning_regex = qr/^(.+?):(\d+):\d+: warning: (.+?) \[(.+?)\]$/;
# Ignore lines with no compiler commands.
next if not $non_verbose
- and not $line =~ /\b$cc_regex(?:\s|\\)/o;
+ and not $line =~ /$cc_regex_normal/o;
# Ignore lines with no filenames with extensions. May miss some
# non-verbose builds (e.g. "gcc -o test" [sic!]), but shouldn't be
# a problem as the log will most likely contain other non-verbose
\s.+\s
-I/usr/share/qt4/mkspecs/[a-z]+-g\++(?:-64)?
\s}x;
+ # Ignore false positives when the line contains only CC=gcc but no
+ # other gcc command.
+ if ($line =~ /(.*)CC=$cc_regex_full(.*)/o) {
+ my $before = $1;
+ my $after = $2;
+ next if not $before =~ /$cc_regex_normal/o
+ and not $after =~ /$cc_regex_normal/o;
+ }
# Check if additional hardening options were used. Used to ensure
# they are used for the complete build.