Skip to contentSkip to conversation

C undefined behavior fix

PATCH [email protected] 1 participant 1 message Jan 7, 2002

lore
Share & tools
lore
#0 lore raw

<<You're not allowed to be that smart wrt volatile. If the programmer says the value might change unpredictably and should not be optimized, then It Is So and the compiler must respect that even if it determines It Cannot Possibly Happen.

Quoted 1 line
Quoted 1 line

Indeed, this is the case, for example, you may have a hardware monitor on the bus, and you are looking for this address, or some external process may be modifying the location. Or you may legitimately use volatile so that your debugger works as expected on this location.