Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: Bitfields in unions Message-ID: <680@taumet.com> Date: 20 Apr 91 22:01:35 GMT References: Organization: Taumetric Corporation, San Diego Lines: 14 em@dce.ie (Eamonn McManus) writes: >Can a union contain a bitfield? K&R2 obliquely implies no, while >gcc -pedantic says yes. I'm inclined to believe K&R myself, though >at least on machines without alignment constraints such a thing >would seem reasonable. The ANSI C standard says explicitly that a union may contain a bitfield. The alignment argument is irrelevant, as it is up to the compiler to see that an object of union type is aligned suitably. -- Steve Clamage, TauMetric Corp, steve@taumet.com