Re: [PATCH] doc: volatile considered evil

Alan Cox
2007-05-09T20:19:34Z

On Wed, 9 May 2007 11:41:27 -0700 (PDT)
David Rientjes <rientjes@google.com> wrote:

> On Wed, 9 May 2007, Alan Cox wrote:
>
> > > Thus, any reliance on type-qualifying an object that represents an atomic
> > > or locking primitive on the keyword 'volatile' is misplaced.
> >
> > arch/foo is generally implementation specific code.
> >
>
> That's true, but what qualifies as an "access" to an object that is
> type qualified with the 'volatile' keyword is _implementation_ defined,
> meaning the behavior is defined by the compiler and not this new
> architecture you're proposing 'volatile' is appropriate for. That's pure
> C99.

arch/foo almost always supports a single compiler too - gcc. We simply
don't support anything else. We use gcc inlines and features extensively.

And who cares about such fine detail of C99, did they fix the struct copy
bug in ANSI C even ? [1]

Alan
[1] ANSI C says access to the padding fields of a struct is undefined.
ANSI C also says that struct assignment is a memcpy. Therefore struct
assignment in ANSI C is a violation of ANSI C...

At this point its a lot simpler not to care about other compilers pet
insanities or areas of the spec like volatile that are vaguer and less
credible than the output of the US congress.