From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3542 invoked by alias); 14 Jul 2009 22:31:41 -0000 Received: (qmail 3497 invoked by uid 48); 14 Jul 2009 22:31:29 -0000 Date: Tue, 14 Jul 2009 22:31:00 -0000 Message-ID: <20090714223129.3496.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40751] G++ never packs typedef'd enums In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bryce dot schober at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg01172.txt.bz2 ------- Comment #2 from bryce dot schober at gmail dot com 2009-07-14 22:31 ------- I now see that the following syntax packs as expected: typedef enum { ZERO = 0, ONE, TWO } __attribute__ ((packed)) my_enum_t; I have been unable to find a concise definition of how attributes are supposed to be used with types in either the Type-Attributes or Attribute-Syntax sections of the GCC manual. I guess this location for the attribute is a bit more logical in the sense that the type isn't "complete" until the closing brace. It remains unclear whether both attribute locations are supposed to be supported in both C and C++ or not. Either way, it's certainly not clear from the docs. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40751