Dear clang Developers,
this is a follow-up on a bug report [3], as I encountered the same
problem. The ccc-analyzer script used during the scan-build static
analysis process is not properly forwarding options to the underlying
compiler. The '-isystem' flag, which marks an include directory to
contain system headers, is only forwarded if a white space is present
between "-isystem" and <path>. While both clang rev 226467 and gcc 4.8.3
support both ("-isystem <path>" and "-isystem<path>"), the ccc-analyzer
can only handle version with a white space.
There is no clear documentation whether "-isystem" can contain a
whitespace, but the gcc documentation states, that "-isystem" can be
used in place of "-I" [1] which suggest to use it without a whitespace.
Clang's user manual has one example on using "-isystem", but with a
white space [2]. I added an example makefile with instructions how to
reproduce this problem to the above bug report.
I attached a patch which enables ccc-analyzer to accept and forward both
the "-isystem <path>" and "-isystem<path>" variant.
Thanks,
Thomas
The attached patch was created against 227046.
Affected Files:
tools/scan-build/ccc-analyzer
[1]
https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
[2]
http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-in-system-headers
[3]
http://llvm.org/bugs/show_bug.cgi?id=13237
Index: tools/scan-build/ccc-analyzer
===================================================================
--- tools/scan-build/ccc-analyzer (revision 226526)
+++ tools/scan-build/ccc-analyzer (working copy)
@@ -353,7 +353,6 @@
'-imacros' => 1,
'-iprefix' => 1,
'-iquote' => 1,
- '-isystem' => 1,
'-iwithprefix' => 1,
'-iwithprefixbefore' => 1
);
@@ -572,7 +571,7 @@
}
# Compile mode flags.
- if ($Arg =~ /^-[D,I,U](.*)$/) {
+ if ($Arg =~ /^-[D,I,U,isystem](.*)$/) {
my $Tmp = $Arg;
if ($1 eq '') {
# FIXME: Check if we are going off the end.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits