diff options
Diffstat (limited to 'test-static')
-rwxr-xr-x | test-static | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test-static b/test-static new file mode 100755 index 0000000..85d7f4f --- /dev/null +++ b/test-static @@ -0,0 +1,14 @@ +#!/bin/sh +# We don't use printf's percent notation with our custom logging mechanism, +# so the compiler cannot check it for us like it usually does +perl -n0777 - "$(dirname "$0")"/xC.c <<-'END' + while (/\blog_[^ ]+\s*\([^"()]*"[^"]*%[^%][^"]*"/gm) { + my ($p, $m) = ($`, $&); + printf "$ARGV:%d: suspicious log format string: %s...\n", + (1 + $p =~ tr/\n//), ($m =~ s/\s+/ /rg); + $status = 1; + } + END { + exit $status; + } +END |