g++ and aliasing bools

Mark Mitchell mark@codesourcery.com
Fri Jan 25 14:21:00 GMT 2002


> Conclusion: if program P exists, we can convert the relevant parts of
> the point where we miscompile it into a C program, and GCC will also
> miscompile the C program.  (imagine passing it through, say, EDG's
> or KAI's C++ to C compiler).

OK, I like this argument.  *I* find it convincing, at least. :-)

Implicitly, you're assuming that a simple_enough C++ struct (minus
member functions and gunk) is also a C struct.  There's one pedantic
case where this is false: zero-sized structs are not part of ANSI/ISO
C89, but are part of C++.  But, they are supported in GNU C, so
your reduction still works.

Thanks for taking the time to work out the reduction explicitly.

Therefore, I'll pre-approve the patch, in concept -- but only for 3.2.
(I can't see how this is a "bug fix" by the criteria we've been using.)

So, after the branch, let's have a patch to do this.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com



More information about the Gcc mailing list