Even without volatile, the compiler is very arguably buggy if it writes
values to your variables that were never supposed to be there.
Take this, for example:
sig_atomic_t value = 1;
int fn()
{
value = 2;
}
And a signal comes in. Even without the volatile, if gcc has written
_anything_ else than 1 or 2 into the variable, gcc is BROKEN.
There's no point being a language lawyer and saying that gcc "could write
anything to value before it writes the final 2". Tha's not true. A compile
rthat does that is
(a) buggy as hell from a POSIX standpoint
(b) even apart from POSIX, from a Q-of-I standpoint complete and utter
crap.
And yes, the argument for "page->flags" is _exactly_ the same. Writing
intermediate values to "page->flags" that were never referenced by the
programmer is clearly such a violation of QoI that it is a bug even if
"sig_atomic_t" happens to be "int", and "page->flags" happens to be
"unsigned int".
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/