Re: [PATCH] C undefined behavior fix

Horst von Brand (brand@tigger.cs.uni-dortmund.de)
Fri, 11 Jan 2002 10:52:08 +0100


Bernard Dautrevaux <Dautrevaux@microprocess.com> said:

[...]

> So at least for the first test, gcc-3.1 generates the same (anoying) code as
> 2.95.3. I'm quite sure this is legal, as I can't see in the standard if when
> writing:
>
> volatile unsigned int x:8;
>
> I define:
> 1) a volatile 8-bit field to be interpreted as an unsigned int.
> 2) an 8-bit field which is part of a volatile unsigned int.

If the whole is volatile (x must be inside a struct) make that volatile.
Sounds quite natural to me...

-- 
Horst von Brand			     http://counter.li.org # 22616
-
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/