This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
problems with packed ennums in g++
- To: gcc at gcc dot gnu dot org
- Subject: problems with packed ennums in g++
- From: development at sieb-meyer dot de
- Date: Thu, 1 Nov 2001 16:40:46 +0100
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