From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7668 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Access through cast to volatile Date: Sun, 17 May 2015 21:21:17 +0300 (MSK) Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: ger.gmane.org 1431886894 14077 80.91.229.3 (17 May 2015 18:21:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 May 2015 18:21:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7680-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 17 20:21:34 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Yu3Bu-0006E0-1q for gllmg-musl@m.gmane.org; Sun, 17 May 2015 20:21:34 +0200 Original-Received: (qmail 1867 invoked by uid 550); 17 May 2015 18:21:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1838 invoked from network); 17 May 2015 18:21:29 -0000 User-Agent: Alpine 2.11 (LNX 23 2013-08-11) Xref: news.gmane.org gmane.linux.lib.musl.general:7668 Archived-At: 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.