This is the mail archive of the gcc-bugs@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]

[Bug c++/7385] [3.3/3.4 Regression] g++ problems with enum and __attribute__


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;


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