[cfe-dev] [clang static analyzer] How can I analyze one single C file now?

Liu proljc at gmail.com
Fri Sep 23 18:08:21 PDT 2011


On Sat, Sep 24, 2011 at 2:17 AM, Anna Zaks <ganna at apple.com> wrote:
> Hi Liu,
>
> Most likely, the analyzer does not find any issues in your input file. You can double verify that by checking if anything is reported in the plist file (you can examine it with a text editor). The default behavior is to create a plist file as well as print out the diagnostics on the screen.

Thanks for reply.

This is my file

#include <stdio.h>

int main(void)
{
  int a = 1;
  int b = 3;
       ^--------------unused vars.

  printf("haha");
                     ^----------------NO'\n' here.
-----------------------NO return here.
}

This is a.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>files</key>
 <array>
 </array>
 <key>diagnostics</key>
 <array>
 </array>
</dict>
</plist>

Is it alright? I thought I should get something.

Thanks again.

--Liu

>
> Cheers,
> Anna.
>
>
> On Sep 23, 2011, at 10:44 AM, Liu wrote:
>
>> Hi all
>>
>> I run "clang --analyze a.c" just get a a.plist, no output in screen.
>> How can I analyze one single C file? "clang --analyze FILE" used to be
>> OK, but not for now:(
>>
>> --Liu
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list