This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH for c/52085 (enum forward declarations and attribute packed)


On Thu, Apr 23, 2015 at 08:25:51PM -0600, Jeff Law wrote:
> What happens if we have used the enum inside an aggregate?  Can we just
> blindly change the alignment/precision like that?
 
If you just forward declare an enum/struct, it has an incomplete type, so you
cannot use it inside an aggregate.  In fact, you can't do much with that until
it's completed, except creating a pointer to it.  E.g. applying sizeof to an
incomplete type is forbidden.  With my patch, we behave the same as clang.

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]