Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 17 May 2015 21:21:17 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Access through cast to volatile

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?

(I realize it's offtopic, but I hope it's acceptable)

> > See this question on SO, which has two
> > conflicting and both reasonable-sounding answers:
> > 
> > http://stackoverflow.com/questions/28654418/requirements-for-behavior-of-pointer-to-volatile-pointing-to-non-volatile-object
> 
> thanks for the pointer, I didn't knew about the text in the rationale.
> 
> This could be an indication that the text as it is in the standard is
> a defect.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.