GCC C bug: sizeof a union of structs returns zero value

Richard Henderson rth@redhat.com
Fri Dec 17 09:04:00 GMT 2004


On Thu, Dec 16, 2004 at 06:52:35PM -0800, Hugh Daniel wrote:
> char ccc[ sizeof( union{ struct aaa; struct bbb; })];

In ISO Standard C, this doesn't do what you think it does.

What you are attempting to use is an ill-conceived Microsoft
extension.  You can enable *some* amount of support for this
in gcc by using -fms-extensions.


r~



More information about the Gcc-bugs mailing list