mailing list of musl libc
 help / color / mirror / code / Atom feed
* Access through cast to volatile
@ 2015-05-17 18:21 Alexander Monakov
  2015-05-17 19:35 ` Jens Gustedt
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Monakov @ 2015-05-17 18:21 UTC (permalink / raw)
  To: musl

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-17 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-17 18:21 Access through cast to volatile Alexander Monakov
2015-05-17 19:35 ` Jens Gustedt

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).