[PATCH] scan-build to accept all "-isystem" variants

Thomas Hauth Thomas.Hauth at kit.edu
Sun Jan 25 07:40:32 PST 2015

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.


The attached patch was created against 227046.

Affected Files:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccc-analyzer-isystem-no-whitespace.patch
Type: text/x-patch
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150125/cee73100/attachment.bin>

More information about the cfe-commits mailing list