Re: [gtkmm] #pragma pack(1) and Gtk string Segmentation Faults
- From: Paul Davis <pbd op net>
- To: "Stephen G. Tashiro" <tashiro trac wsmr army mil>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] #pragma pack(1) and Gtk string Segmentation Faults
- Date: Wed, 03 Jul 2002 18:42:32 -0400
>In a gtkmm application I #included a header file (written by another programm
>er) which contains the line:
fire this programmer unless he was writing device drivers. if so, stop
including his header files. i am deadly serious.
you **CANNOT** **EVER** expect to use this in combination with any C
or C++ library that was compiled without this pragma, and since that
almost certainly means (g)libc on your system, the end result is that
you should **NEVER** **EVER** use this pragma in general purpose code.
gcc has the __attribute__ keyword, which is the right way to control
struct member alignment in those structs that need it. use the pragma
will change the layout of many structures declared in system headers,
gtk+ headers, gtkmm headers and god knows what else.
if the pragma has to be used for some bizarre reason, the header file
in which it was used is not suitable for use in any program other than
the one with the bizarre reason.
did i make that clear enough? :))
] [Thread Prev