I would actually like to defend the CF compiler, but I don't think this reordering of volatile accesses (here volatile writes) is reasonable (or are legal according to C99/C++98). I think here the compiler should be changed.
For the standard volatile definitions, as far as I remember (did not look it up now), C89 is not so precise in this topic, so could be that the compiler does not violate this standard, but that does not make the behavior better tough.
But actually the C++ and the more recent C99 standard are both more specific about volatile.
The wikipedia article is nice, but not really normative. Maybe it could be a bit extended :smileyhappy:.
Hmm. With wikipedia references it works pretty much the other way round than with standard references.
If a compiler does not match the standard, we should change the compiler.
If a compiler not match wikipedia (but follows the standards), we should change wikipedia :smileyhappy:.
Did you submit a
service request for this issue?
Daniel