On Mon, Oct 15, 2012 at 10:48:13PM -0700, Xinliang David Li wrote: > Another error checking feature is to poison stack vars on entry and > exit of the lexical scope to catch uninit variable reference and out > of scope references: > > S* sp; > { > S s; > sp = &s; > } > .. *sp ... > > This is relatively easy to do in gcc thanks to the clobber statement. > In Clang/LLVM, it is in the wishlist: > http://code.google.com/p/address-sanitizer/issues/detail?id=83
That is not easy at all unfortunately, CLOBBER isn't sufficient for that. You have the points where the variable looses value, but there aren't similar markup statement where it gets into scope again. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54770#c3 Jakub