This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: QUESTION: strange behaviour of typedef enum and __attribute__((packed)) using sh-hms-g++ 3.0.3


if I write:
typedef enum en {em_f1 = 0, em_f2, em_f3}__attribute__((packed)) em_t;

I obtain a sintzx error;
if I write:
typedef enum en {em_f1 = 0, em_f2, em_f3}em_t __attribute__((packed)) ;

everything works fine at compile time but the sizeof is not packed neither 
aligned.

The same happens with __attribute__((packed),aligned(1)))

I solved the proble using -fshort-enums in CXXFLAGS and CFLAGS.

Regards.

Alle 15:25, mercoledì 11 dicembre 2002, William A. Gatliff ha scritto:
> Fabio:
> > If I define
> > typedef enum en {em_f1 = 0, em_f2, em_f3} em_t
> > __attribute__(((packed),aligned(1)));
>
> What happens if you leave the aligned(1) off?
>
>
> b.g.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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