X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;h=4a1c0b1a5b992f089932136e21fee6d8711b81b4;hp=b4d87e45eb9dc856e574906e4958afc04f4317d5;hb=1e107c19fd86533a6e0eb426904d6e48b6876844;hpb=bbdf77da3205abbc957d6b720e01f6d390db46dc diff --git a/bin/blhc b/bin/blhc index b4d87e4..4a1c0b1 100755 --- a/bin/blhc +++ b/bin/blhc @@ -144,7 +144,7 @@ my $file_extension_regex = qr/ \s \S+ # Filename without extension. \. - ([^\\.\s]+) # File extension. + ([^\\.,;:\s]+) # File extension. (?=\s|\\) # At end of word. Can't use \b because some files have non # word characters at the end and because \b matches double # extensions (like .cpp.o). Works always as all lines are @@ -572,23 +572,21 @@ FILE: foreach my $file (@ARGV) { } # Ignore lines with no compiler commands. - next if $line !~ /\b$cc_regex(?:\s|\\)/o and not $non_verbose; + next if not $non_verbose + and not $line =~ /\b$cc_regex(?:\s|\\)/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 commands which are detected. + next if not $non_verbose + and not $line =~ /$file_extension_regex/o; # Ignore false positives. # # `./configure` output. next if not $non_verbose and $line =~ /^(?:checking|(?:C|c)onfigure:) /; - next if $line =~ /^\s*(?:Host\s+)?(?:C\s+)? - (?:C|c)ompiler[\s.]*:?\s+ - $cc_regex_full - (?:\s-std=[a-z0-9:+]+)?\s*$ - /xo - or $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o - or $line =~ /^\s*-- Check for working (?:C|CXX) compiler: / - or $line =~ /^\s*(?:echo )?Using [A-Z_]+\s*=\s*/; - # `make` output. - next if $line =~ /^Making [a-z]+ in \S+/; # e.g. "[...] in c++" + next if $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o; # Check if additional hardening options were used. Used to # ensure they are used for the complete build.