From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14087 invoked by alias); 14 Jul 2009 19:02:45 -0000 Received: (qmail 10910 invoked by uid 48); 14 Jul 2009 19:02:26 -0000 Date: Tue, 14 Jul 2009 19:02:00 -0000 Subject: [Bug c++/40751] New: G++ never packs typedef'd enums X-Bugzilla-Reason: CC Message-ID: 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/msg01147.txt.bz2 The following enumerated type definitions packs to one byte as expected in C, but not in C++: typedef enum __attribute__ ((packed)) { ZERO = 0, ONE, TWO } my_enum_t; The enum will pack as expected if using -fshort-enums, but that doesn't allow me to pack on a per-enum basis. Neither will the above enum pack as a packed member in a structure or as a member in a packed structure. Test case to follow. -- Summary: G++ never packs typedef'd enums Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bryce dot schober at gmail dot com GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40751