From: Simon Ruderich Date: Sun, 5 Jun 2016 12:33:29 +0000 (+0200) Subject: Fix false positives for comment lines X-Git-Tag: 0.06~2 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=a0f80b21eb2a1cc3bb306a68fb7a3beed1df9072;p=blhc%2Fblhc.git Fix false positives for comment lines Closes Debian bug #825671. --- diff --git a/NEWS b/NEWS index a3c4c88..ffe3da0 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ Version 0.XX - Sync architecture specific hardening support with dpkg 1.17.18. - Update t/tests.t for new output of Pod::Usage in 1.65 (Debian Bug #825428), reported by Niko Tyni, patch by Gregor Herrmann. +- Fix false positives for comment lines (Debian Bug #825671), reported by + Fabian Wolff. Version 0.05 diff --git a/bin/blhc b/bin/blhc index efb7f3b..4d2fb09 100755 --- a/bin/blhc +++ b/bin/blhc @@ -850,6 +850,7 @@ foreach my $file (@ARGV) { } } + next if $line =~ /^\s*#/; # Ignore compiler warnings for now. next if $line =~ /$warning_regex/o; diff --git a/t/logs/false-positives b/t/logs/false-positives index 8ef70d6..c7487f7 100644 --- a/t/logs/false-positives +++ b/t/logs/false-positives @@ -8,6 +8,9 @@ swig -Wall -c++ -python test.i rm -f afl-gcc afl-as afl-fuzz afl-showmap as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 +# "Missing" flags in comments should be ignored. +# gcc -E tag_tree.list does not work, so use a .c name + # gcc -v can cause false positives. cd GUI && qmake /usr/bin/make -C GUI