[cfe-dev] Issue #1 from RTEMS run of clang-analyzer

Joel Sherrill joel.sherrill at OARcorp.com
Thu Sep 30 04:19:22 PDT 2010


  On 09/30/2010 03:18 AM, John Bytheway wrote:
> On 29/09/10 18:51, Ted Kremenek wrote:
>> Hi Joel,
>>
>> I looked into this issue.  The error is coming from the compiler, which
>> is directly forwarded the arguments (with no extra interpretation) from
>> ccc-analyzer.  I'm not certain where the issue is, because I see this
>> problem even when just using the compiler directly (and not using
>> scan-build).  For example:
>>
>> $ touch t.c
>> $ cat Makefile
>> t.o:
>> $(CC) -DFOO=\"Foo Bar\" -c t.c
>>
>> clean:
>> rm -f t.o
>>
>> all: t.o
>>
>> $ CC=gcc make
>> gcc -DFOO=\"Foo Bar\" -c t.c
>> i686-apple-darwin11-gcc-4.2.1: Bar": No such file or directory
>> <command-line>: warning: missing terminating " character
>> make: *** [t.o] Error 1
>>
>>
>> Note that if I change the relevant line in the Makefile to:
>>
>> t.o:
>>          $(CC) -DFOO='"Foo Bar"' -c t.c
>>
>>
>> the problem goes away.
> Indeed, this example is a bug in the Makefile.  In the first form the
> shell will see two words, not one.  You need to quote or escape the
> space as well as the double quotes, such as is done in the revised
> version above.  This would work too:
>
> t.o:
>          $(CC) -DFOO=\"Foo\ Bar\" -c t.c
>
I have attached my version of the Makefile with the "DEFS"
line from the Makefile generated by autoconf.  It appears
to be properly escaped.    The following commands work
fine for it.

make clean all
CC=gcc make clean all

But "scan-build make clean all" fails.
> John Bytheway
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100930/5c8b6083/attachment.ksh>


More information about the cfe-dev mailing list