[Bug c++/7385] [3.3/3.4 Regression] g++ problems with enum and __attribute__
jason at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Aug 29 20:48:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7385
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
------- Additional Comments From jason at gcc dot gnu dot org 2003-08-29 20:48 -------
This observed behavior was the intent of the patch. The gcc trunk gives this
additional error for your testcase:
error: `typedef enum <anonymous> e1' does not refer to the unqualified
type, so it is not used for linkage
You want to write
enum e1 { v11=1, v12=2 } __attribute__ ((packed));
instead, so that the attribute applies to the enum rather than the typedef. If
you want to use "e1" without "enum" in C, you can then write
typedef enum e1 e1;
More information about the Gcc-bugs
mailing list