LLVM Compiler

TwitterFacebook
Get flash to fully experience Pearltrees
http://code.google.com/p/address-sanitizer/wiki/AddressSanitizer New : AddressSanitizer is released as part of LLVM 3.1. New : Watch the presentation from the LLVM Developer's meeting (Nov 18, 2011): Video , slides . New : Read the USENIX ATC '2012 paper . AddressSanitizer (aka ASan) is a memory error detector for C/C++. It finds: This tool is very fast.

AddressSanitizer - address-sanitizer - AddressSanitizer: a fast memory error detector - AddressSanitizer: a fast memory error detector

AddressSanitizer, a fast memory error detector

http://clang.llvm.org/docs/AddressSanitizer.html Simply compile and link your program with -fsanitize=address flag. The AddressSanitizer run-time library should be linked to the final executable, so make sure to use clang (not ld ) for the final link step. When linking shared libraries, the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link errors (don’t use it with AddressSanitizer).
If you've wanted to add static analysis to your C/C++ project which uses CMake but didn't know how, then you'll want to read this. This post is mostly a note for myself so I don't have to google it later ;) If you're using Debian it's actually quite easy. Just install the clang package with: http://garykramlich.blogspot.com/2011/10/using-scan-build-from-clang-with-cmake.html

using scan-build from clang with cmake

http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Clang-Defending-C-from-Murphy-s-Million-Monkeys Were we to craft a Lenox Globe of programming languages, C++ might be followed by a famous cautionary phrase: Here Be Dragons. The language can be complex and daunting to programmers who are often shouldered with the task of writing large, complex programs. Those millions of code monkeys need help to resist Murphy's siren song and navigate C++'s treacherous waters of memory corruption and concurrency bugs.

Clang: Defending C++ from Murphy's Million Monkeys | GoingNative 2012