Question about -ansi flag, and different size of struct from C and C++

Ralf Corsepius corsepiu at
Tue Dec 16 08:13:50 UTC 2003

On Tue, 2003-12-16 at 08:35, Oleg Ivanov wrote:
> Yes, I know, I try it, but it also don't work with -ansi flag :-\
> > There is a command line option of GCC (-fpack-struct) that makes *all* 
> > your structs packet. It could make your code binary incompatible with 
> > pre-comiled libraries.
I've never used -fpack-struct, but AFAICT, all -fpack-struct does is to
globally do the same as __attribute__((packed)) does to individual

So if your target does not support packing, -fpack-struct also probably
will not help you.

You'll have to redesign your code, if you want your code to be portable.


More information about the users mailing list