This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing warning about uninitialized variable.


J.C. Pizarro wrote:
There is some strange in the generated program.

For large projects with uninitialized variables, the behaviour
could be stochasticly flawed as a russian roulette.

Can I just end this with "undefined behaviour is not defined?"


If you want to know what is actually going on, fire up gdb, and single-step asm operations. Most likely "3" is some counter in the optimized case, (just happens to be) and not in the others. Who cares, it's undefined.

And stop using "stochastically random" too ... that's annoying. It's called "garbage" (not to be confused with MSFT software ...).

:-)

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]