From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx112.postini.com [74.125.245.112]) by kanga.kvack.org (Postfix) with SMTP id 2C41C6B0005 for ; Wed, 3 Apr 2013 22:00:36 -0400 (EDT) Received: by mail-vc0-f175.google.com with SMTP id hf12so1993713vcb.34 for ; Wed, 03 Apr 2013 19:00:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <3ae9b7e77e8428cfeb34c28ccf4a25708cbea1be.1364938782.git.jstancek@redhat.com> <20130403041447.GC4611@cmpxchg.org> <20130403045814.GD4611@cmpxchg.org> <20130403143302.GL1953@cmpxchg.org> Date: Wed, 3 Apr 2013 19:00:34 -0700 Message-ID: Subject: Re: [patch] compiler: clarify ACCESS_ONCE() relies on compiler implementation From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Andrew Morton , Ian Lance Taylor , Hugh Dickins , Jan Stancek , Paul McKenney , Johannes Weiner , linux-mm On Wed, Apr 3, 2013 at 6:52 PM, David Rientjes wrote: > > The specification here says an access to this volatile quaified pointer is > implementation defined .. and my argument is that we don't care about paper standards, we care about QUALITY OF IMPLEMENTATION. If a compiler messes up volatile casts, the quality of implementation is bad. There's just no excuse. The compiler people can talk about how the paper standard allows it until the cows come home. Why should we care? The compiler person is still just making excuses for a bad implementation. There is no sane alternative semantics to "volatile" that I can come up with. Seriously. What meaning could "volatile" ever have that would be sensible and break this? Now, I do repeat: I don't like volatile. I think it has many problems, and being underspecified is just one of them (the much deeper problem is that the C standard attaches it to the data, not to the code, and we then have to "fix" that by mis-using it as a cast). So if some improved standard comes along, I'd happily use that. In the meantime, we don't have any choice, do we? Seriously, you can talk about paper standards until you are blue in the face, but since there is no sane alternative to the volatile cast, what's the point, really? Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org