This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: Horst von Brand <brand at tigger dot cs dot uni-dortmund dot de>
- To: Bernard Dautrevaux <Dautrevaux at microprocess dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, "'linux-kernel at vger dot kernel dot org'" <linux-kernel at vger dot kernel dot org>
- Date: Fri, 11 Jan 2002 10:52:08 +0100
- Subject: Re: [PATCH] C undefined behavior fix
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