[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] gcc and g++ mbuff confusion. __attribute__((packed))



>>>>> "Tomasz" == Tomasz Motylewski <motyl@stan.chemie.unibas.ch> writes:

 Tomasz>...
 Tomasz> Even using

 Tomasz> typedef struct { ..........  } __attribute__((packed))
 Tomasz> shm_slut_t;

 Tomasz> does not save the problem, because sizeof(bool)==4 in gcc and
 Tomasz> 1 in g++.

 Tomasz> I would like to use this opportunity to stress once again the
 Tomasz> importance to use the same compiler flags, volatile, and
 Tomasz> __attribute__((packed)) to get right any shared structures.

Interesting.  "bool" is a builtin type in C++, but not in C.  I'm a
bit surprised it even works at all.  Perhaps there's a conditional in
one of the header files that does a typedef or #define for it -- and
if so, perhaps it's defined to be "int"...  

	paul