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

problems with packed ennums in g++



Hi,

I have some problems with 'packed enums'.

- I would like to pack a enum in a 16 Bit word.

- I tried the  ' __attribute__ ((packed))'   definition. sizeof(myenum) is
4 Bytes.

- I tried the compiler switch  ' -fshort_enums'.
  It works, but I can't use it because some other include-files uses
standard 4 Byte-size.

- I tried the  ' #pragma pack(2)'   pragma in combination with '#define
HANDLE_SYS5_PRAMA 1'
  and   '#define HANDLE_PRAGMA_PACK_PUSH_POP 1'  . It don't work.

I'm using g++ 2.95.


Is there a way to define 16 bit enums?


Hans Petersen

email: development@sieb-meyer.de


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