# CONSTANTS/VARIABLES
+# Regex to catch compiler commands.
+my $cc_regex = qr/((?<!\.)cc|(x86_64-linux-gnu-)?gcc|g\+\+|c\+\+)/;
+
# Regex to catch (GCC) compiler warnings.
my $warning_regex = qr/^(.+?):([0-9]+):[0-9]+: warning: (.+?) \[(.+?)\]$/;
} else {
# Ignore lines with no compiler commands.
- next if $line !~ /\b((?<!\.)cc|gcc|g\+\+|c\+\+)(\s|\\)/;
+ next if $line !~ /\b$cc_regex(\s|\\)/;
# Ignore false positives.
#
# Ignore false positives.
#
# ./configure summary.
- my $cc_regex = qr/(cc|(x86_64-linux-gnu-)?gcc|g\+\+|c\+\+)/;
next if $line =~ /^\s*(C|c)ompiler[\s.]*:\s+$cc_regex(\s-std=[a-z0-9:+]+)?\s*$/
or $line =~ /^\s*- (CC|CXX)\s*=\s*$cc_regex\s*$/
or $line =~ /^\s*-- Check for working (C|CXX) compiler: /;