[cfe-dev] XCode 4.3 and Clang vs AppCode static analysis question.

Anna Zaks ganna at apple.com
Mon Apr 30 12:30:10 PDT 2012

On Apr 24, 2012, at 7:31 AM, Seamus McGowan wrote:

> Hello,
> I have attempted to run Clang from the command line to see if its an issue with the XCode project but encounter this error:
> 	clang: error: unsupported option '--serialize-diagnostics'
You can investigate if the analyzer is triggered on your code by adding a function with a bug in it and analyzing the code base.
Ex: Add the following function and run XCode->Product->Analyze:
int foo(int x) {
  if (x == 0)
    return 5/x;
  return 10/x;

I am not sure exactly how you are analyzing from command line, but the error you are getting is probably due to mismatched versions of XCode and the analyzer.

> (I'm trying to find out what this option is and where its set in the project.)

There is also an option in the XCode Build settings called "Run Static Analyzer", which would enable the analyzes during the build.

> NB, This project was originally started in XCode 4 , pre-ARC, and I have no idea if the project required tweaks or fixes in order to build.
> Any pointers in understanding the capabilities of clang and how to work with it properly would be appreciated.
> Seamus
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120430/99766d24/attachment.html>

More information about the cfe-dev mailing list