This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19515] [4.0 Regression] Violation of C99 6.7.8 §21 for unions
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2005 11:49:47 -0000
- Subject: [Bug middle-end/19515] [4.0 Regression] Violation of C99 6.7.8 §21 for unions
- References: <20050118221058.19515.ebotcazou@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-20 11:49 -------
> For structures, this would mean that any structure with holes would get
> cleared. Which would clearly pessimize a very common case.
I considered that too. But, what about structures that
contain a union?
typedef struct {
int i;
union {
int j[2];
float f;
} u;
} S;
void abort (void) __attribute__((noreturn));
int main(void)
{
S s = { .i = 1, {.f = 1.0 } };
if (s.u.j[1] != 0)
abort ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19515