From: Simon Ruderich Date: Thu, 25 Aug 2016 15:46:46 +0000 (+0200) Subject: Fix false positive in "gcc > file" X-Git-Tag: 0.07~2 X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=commitdiff_plain;h=e00e2e347199b213d24540949b832d14cf5bd5dc;hp=766ce7c378d81e02b6cf993ba5c39f8729daf43a Fix false positive in "gcc > file" --- diff --git a/NEWS b/NEWS index 8f6731c..2f964cb 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ Version 0.XX ------------ - Sync architecture specific hardening support with dpkg 1.18.10. +- Fix false positive in "gcc > file" (Debian Bug #828789), reported by Mathieu + Parent. Version 0.06 diff --git a/bin/blhc b/bin/blhc index 838f3c3..c4e814c 100755 --- a/bin/blhc +++ b/bin/blhc @@ -972,6 +972,8 @@ foreach my $file (@ARGV) { # look like a compiler executable thus causing the line to be # treated as a normal compiler line. next if $line =~ m{^\s*rm\s+}; + # Some build systems emit "gcc > file". + next if $line =~ m{$cc_regex_normal\s*>\s*\S+}; # Check if additional hardening options were used. Used to ensure # they are used for the complete build. diff --git a/t/logs/false-positives b/t/logs/false-positives index c7487f7..0a6099d 100644 --- a/t/logs/false-positives +++ b/t/logs/false-positives @@ -11,6 +11,8 @@ rm -f afl-gcc afl-as afl-fuzz afl-showmap as afl-g++ afl-clang afl-clang++ *.o * # "Missing" flags in comments should be ignored. # gcc -E tag_tree.list does not work, so use a .c name +19:49:25 runner ../source3/script/build_env.sh /build/samba-4.4.4+dfsg/source3 /build/samba-4.4.4+dfsg/source3 /usr/bin/gcc > default/source3/include/build_env.h + # gcc -v can cause false positives. cd GUI && qmake /usr/bin/make -C GUI