<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Mikhail,<div><br></div><div>You seem to have some custom set up. Have you tried downloading the latest analyzer package and following the instructions on running scan-build on your project?</div><div><a href="http://clang-analyzer.llvm.org/scan-build.html">http://clang-analyzer.llvm.org/scan-build.html</a></div><div><br></div><div>Cheers,</div><div>Anna.</div><div><br><div><div>On Jun 24, 2013, at 1:44 AM, Duglas Mikle <<a href="mailto:drongoa6@yandex.ru">drongoa6@yandex.ru</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>Hi Ted,<br><br>my name is Mikhail, I'm trying to adopt clang for my project. It works with "C", but I couldn't achieve success with C++.<br>I saw similar thread, tried set environment, without success yet.<span class="Apple-converted-space"> </span><br><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-September/011194.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-September/011194.html</a><br>Let me describe what I have and if you can help it will be very appreciated.<br><br><br>linux - Ubuntu<br>g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3<br><br>clang --version<br>clang version 3.3 (tags/RELEASE_33/final)<br><br>which clang<br>/usr/local/bin/clang<br><br>/usr/share/clang/scan-build/scan-build<br><br>People doesn't like get letters in attachment, so I used several source files from here:<br><a href="http://mrbook.org/tutorials/make/">http://mrbook.org/tutorials/make/</a><br><br><br>Then create in the same directory Makefile:<br>all:<br><span class="Apple-tab-span" style="white-space: pre;"> </span>g++ main.cpp hello.cpp factorial.cpp -o hello<br><br>allclang:<br><span class="Apple-tab-span" style="white-space: pre;"> </span>clang++ main.cpp hello.cpp factorial.cpp -o hello<br><br><br>clean:<br><span class="Apple-tab-span" style="white-space: pre;"> </span>rm -rf hello<span class="Apple-converted-space"> </span><br><br>Then create script for scan-build:<br>clang_example.sh<br>===========<br>#!/bin/sh<br><br>export CC="/usr/share/clang/scan-build/ccc-analyzer"<br>export CXX="/usr/share/clang/scan-build/c++-analyzer"<br>export CXXAnalyzer="c++-analyzer"<br><br>#CLANG_PATH="--use-analyzer=/usr/local/bin/clang++"<br>CLANG_PATH="--use-analyzer=/usr/share/clang/scan-build/c++-analyzer"<br>VERBOSE="-v -v"<br><br>export PATH=/usr/share/clang/scan-build:/usr/local/bin:$PATH<br>export CCC_ANALYZER_CPLUSPLUS=1<br><br><br>export LDPLUSPLUS=/usr/share/clang/scan-build/c++-analyzer<br><br>scan-build $VERBOSE $CLANG_PATH -o ./scan_report -k -V make clean allclang<br>===========<br><br>I did small tuning in source files:<br>1) added "using namespace std;" for successful compilation and then<br>2) factorial.cpp<br>replace<br>return(n * factorial(n-1));<br>to<br>return(n * factorial(n-1)/0);<br><br>After these changes I get:<br>----------------------------------------<br><blockquote type="cite">make allclang<br></blockquote>clang++ main.cpp hello.cpp factorial.cpp -o hello<br>factorial.cpp:5:27: warning: division by zero is undefined [-Wdivision-by-zero]<br> return(n * factorial(n-1)/0);<br> ^~<br>1 warning generated.<br>-----------------------------------------<br>Perfect! Clan++ works and point to the Error, but<br><br><blockquote type="cite">sh clang_example.sh<br></blockquote><br>doesn't create report which contains the error.<br>scan-build: Removing directory 'SimpleProject/scan_report/2013-06-24-1' because it contains no reports.<br><br>I tried different workarounds, but it doesn't work. May be I need to install all tools in /usr/bin/ and try to do it one more time, I don't know.<br>Ted, if you have time please help to resolve the issue.<br><br>Best Regards,<br>Mikhail.<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></div></body></html>