Possible Duplicate:
Why do I see strange values when I print uninitialized variables?
Fun with uninitialized variables and compiler (GCC)
I want to know about a mysterious problem which I faced while solving a code issue.
The code which is present in production has an uninitialized boolean variable and a library is checking the value of this boolean. In LIVE site, this variable is behaving as TRUE always The same code in development environment is behaving as FALSE always.
I know, due to the environment difference between LIVE & DEV, an uninitialized bool variable can have an undefined value.
But here is my issue.
If I put a log statement in the code, compile it and put the binary in development environment, the bool variable is having TRUE always, whereas it was FALSE with the code in LIVE.
How does a log statement affect the value of an uninitialized bool variable? I would like to know the possibilities.