From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Access through cast to volatile
Date: Sun, 17 May 2015 21:21:17 +0300 (MSK) [thread overview]
Message-ID: <alpine.LNX.2.11.1505172057400.22867@monopod.intra.ispras.ru> (raw)
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.
next reply other threads:[~2015-05-17 18:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 18:21 Alexander Monakov [this message]
2015-05-17 19:35 ` Jens Gustedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.11.1505172057400.22867@monopod.intra.ispras.ru \
--to=amonakov@ispras.ru \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).