This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix pr23046
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Sep 05 14:41:27 EDT
- Subject: Re: [patch] Fix pr23046
> It seems like that's defining what an overflow would do when assigning
> to a bitfield. But isn't that undefined too?
No. Neither is a copy from unsigned long to unsigned char. It's
the same thing.
Oh, right. I forgot about the unsigned case. But what about the signed case?
If you have
struct foo {int a:2;} b;
b.a = 25;
isn't that undefined?