[cfe-dev] no reports generated

Ted Kremenek kremenek at apple.com
Wed Nov 16 10:15:31 PST 2011


It works fine for me.  What version of scan-build are you using?

On Nov 16, 2011, at 10:10 AM, David Durham wrote:

> Hi all,
> 
> I'm working to integrate scan-build into our process for detecting
> bugs, but running into an issue where I can't seem to coax scan-build
> into generating any reports.  I've placed the following bug in my
> code:
> 
>        int *x = NULL;
>        int y = (*x) * 5;
> 
> And when I run the program, it does segfault.  I have a Makefile like so:
> 
> #CXX       = g++
> CXXFLAGS  = -Iinclude
> TARGET    = clangtest
> LIBS      = -lcppunit
> OBJS      = ${patsubst %.cpp,%.o,${wildcard *.cpp}}
> 
> all: ${TARGET}
> 
> ${TARGET}: ${OBJS}
> 	${CXX} ${CXXFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
> 
> .cc.o:
> 	${CXX} ${CXXFLAGS} -c $<
> 
> clean:
> 	rm -f ${TARGET} ${OBJS}
> 	
> 
> When I run scan-build, here are the results:
> 
> ---
> [ddurham at ddurham test]$ scan-build make clean all
> scan-build: 'clang' executable not found in
> '/usr/lib/clang-analyzer/scan-build/bin'.
> scan-build: Using 'clang' from path: /usr/bin/clang
> rm -f clangtest TestsMain.o ExampleTest.o
> /usr/lib/clang-analyzer/scan-build/c++-analyzer -Iinclude   -c -o
> TestsMain.o TestsMain.cpp
> /usr/lib/clang-analyzer/scan-build/c++-analyzer -Iinclude   -c -o
> ExampleTest.o ExampleTest.cpp
> /usr/lib/clang-analyzer/scan-build/c++-analyzer -Iinclude -o clangtest
> TestsMain.o ExampleTest.o  -lcppunit
> scan-build: Removing directory '/tmp/scan-build-2011-11-16-1' because
> it contains no reports.
> ---
> 
> [ddurham at ddurham test]$ clang -v
> clang version 2.9 (tags/RELEASE_29/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> 
> 
> Am I using the tool incorrectly or is possibly a problem with the
> version of clang, or some other known issue?  Any help is appreciated.
> 
> Thanks,
> Dave
> _______________________________________________
> 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