views:

105

answers:

3

Is there a compiler option in VS 2008 (C++) to expose uninitialized variables? I'm trying to debug a problem where the "release" build of a DLL does not work but the "debug" build of the DLL does work.

+1  A: 

iirc, setting warning level to 4 will help with this

steelbytes
If I set to warning level 4 there are tons of messages that appear. Is there any easy way to find the actual uninitialized variables?
GregH
you can use #pragma to disable the warnings you don't care about
steelbytes
A: 

cl.exe sample.cpp /analyze
here's the link on MSDN

You're looking for warning number C6001

paquetp
I don't have "Team Edition"...I only have VS Standard Edition
GregH
well, nevermind then :(
paquetp
A: 

My normal debug builds seem to have this warning enabled:

warning C4700: uninitialized local variable 'xxx' used

and the warning is not present in a release build.

quamrana