Go Down

Topic: uint32_t weirdness (Read 3981 times) previous topic - next topic


Sep 09, 2016, 03:57 pm Last Edit: Sep 09, 2016, 03:58 pm by KeithRB
The code is not incorrect - it does exactly what you told it to do.
The generated code code *did* match the source in functionality. The value of uninitialised variables with auto storage class is undefined. This is well-known, well-understood behaviour.

Did you read my post above from stackOverflow?

Using an unitialized variable does not automatically result in undefined behavior. It is only undefined if that variable can be also be a "register class" variable. And I am not exactly sure which types in an 8 bit processor can be register class.

Even the link you gave give a lot of exceptions to the undefined behavior rule.

Go Up