FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Clang static code analyzer (memory debug tool based on llvm)

2 posters

Go down

Clang static code analyzer (memory debug tool based on llvm) Empty Clang static code analyzer (memory debug tool based on llvm)

Post  autology Thu Mar 12, 2009 10:34 pm

All,

Not sure how useful this may be, but it was something I stumbled on that helped me out with general bug finding and code validation. This may be something common place amongst the seasoned developers, but it was new to me. (idea from http://sites.google.com/a/superarts.org/studio/中文首页/科技热点/iphone/the-bunnys-iphonedev-faq)

Using Clang Static analyzer (osx binaries built here: http://clang.llvm.org/StaticAnalysisUsage.html )

1. Download the most recent build and extract to a given folder( ex: ~/scanbuild )

2. cd into your project directory ( ex: ~/sio2game )

3. remove the build directory ( rm -rf build )

4. execute the following:( ~/scanbuild/scan-build -k -V xcodebuild )

5. Clang will execute, compiling coding and running a static analysis (evaluating all paths) on the codebase. When complete, an html-based report is generated listing errors - divide by zero, memory leak, retain/copy issues, etc. Beside each error is a link to the piece of code responsible with direct annotation and description on the variables in question.

Process took me ~ 10 minutes on my MBA to compile 1.3.1 and allowed me to find the extra retains that were screwing things up.

YMMV but hope it helps

autology

Posts : 22
Join date : 2008-12-29

Back to top Go down

Clang static code analyzer (memory debug tool based on llvm) Empty Re: Clang static code analyzer (memory debug tool based on llvm)

Post  sio2interactive Fri Mar 13, 2009 12:28 am

tks for sharing i'll give it a try... I never heard of this tool before... cheers!
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum