Am Sonntag, den 17.05.2015, 21:21 +0300 schrieb Alexander Monakov: > On Sun, 17 May 2015, Jens Gustedt wrote: > > > > I only recently learned that even cast to volatile doesn't help in > > > > cases where the original object to which p points is not declared > > > > volatile. The C standard states that only volatile *declared* objects > > > > are subject to the rules of volatile. Accessing through a volatile > > > > pointer doesn't help. > > > > > > I'm not so sure about that. > > > > I am quite sure. We recently had a discussion on that in the > > committee, and the outcome was basically what I was stating above. > > Was the Linux kernel's use of volatile cast in its ACCESS_ONCE macro > discussed? yes But the Linux kernel uses stronger properties than are given by the C standard. It is in many parts built upon assumptions about gcc and its extensions. > (I realize it's offtopic, but I hope it's acceptable) I don't think it is offtopic, we have to be sure what assumptions we want to make. Jens -- :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::