static analyzer warning question

hi All,

would like to know is it possible to get the same warning while run the analyzer as it was produce by simple compilation?

when i give this input test.c

typedef int attribute((visibility(“default”))) bar;

and run Clang against it, i get this warning…

$ clang -c test.c
test.c:1:28: warning: ‘visibility’ attribute ignored [-Wignored-attributes]
typedef int attribute((visibility(“default”))) bar;
1 warning generated.

but when i run the analyzer, i got nothing like that

$ clang -### --analyze -x c test.c

then i execute the last line of this output

$ “clang” “-cc1” …

and it does not generate the warning. my question would be: is it possible to get that warning by passing some extra flags? or it will never appear during the analysis? thanks for any help.


Try playing with -ccc-print-phases. I’m not sure if there’s a way to start both analyzer and compiler action. Compiler action is what reports the warning, you can enable just this action with -fsyntax-only. But passing both --analyze and -fsyntax-only doesn’t seem to work.