> Most C programmers would assume that volatile accesses already > provides this guarantee, so actually doing so would be good.
I'm a little skeptical of this statement: if it was true, how come the most recent version of the standard does not provide it 30 years after the language was first standardized? > Or a more practical example: While debugging some embedded > device, it would also be very annoying if the compilers reorders > some trap before some debugging output. I could easily imagine > loosing hours figuring out what happens. The thing to do to avoid losing these hours is to debug the code at -O0. -- Eric Botcazou