scan-build -analyze-headers issue?

Hi,

scan-build with the -analyze-headers option will not analyze foo() if defined as follows. Code compiles fine with gcc.

test.h:

Sascha,

Please let me know if the following patch against Clang solves the issue for you. It does for me.

AnalysisConsumer.patch (1.24 KB)

Ted Kremenek schrieb:

Sascha,

Please let me know if the following patch against Clang solves the issue for you. It does for me.

Yes, that looks great, foo() gets analyzed now:

yoyodyne# scan-build -analyze-headers make
Warning: Object directory not changed from original /home/s/test
/usr/local/bin/ccc-analyzer -O -pipe -g -c test.c
ANALYZE: ./test.h foo
ANALYZE: test.c main
/usr/local/bin/ccc-analyzer -O -pipe -g -o test test.o
scan-build: Removing directory '/tmp/scan-build-2009-02-02-1' because it contains no reports.

Thank you very much! :slight_smile:

Sascha

Great. I'll commit it to the tree.

Cheers,
Ted