dimanche 31 juillet 2016

Clang static analyzer can't find stdio.h

I'm trying to use Clang static analyzer on a very simple program:

#include <stdio.h>
main ()
{
    printf("Hello, world !");
}

When i do

clang helloworld.c

It compiles the program successfully.


When i do

clang -cc1 -analyze -analyzer-checker=unix helloworld.c

it raises an error:

helloworld.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.

clang --analyze -Xanalyzer -analyzer-checker=unix helloworld.c

doesn't print anything.


What is the problem and how can i fix it? I assume static analyzer doesn't see the header files though the compiler can use them. Please, help me.

Aucun commentaire:

Enregistrer un commentaire