Marko Rauhamaa wrote:
James Yonan <j...@yonan.net>:

Interesting. I wonder if a better solution might be to bracket the struct openvpn_pktinfo definition with

#pragma pack(1)
...
#pragma pack()

Yes, although gcc is allergic to #pragma's. The gcc way of expressing it
is:

          struct __attribute__ ((__packed__)) my_packed_struct
            {
               char c;
               int  i;
               struct my_unpacked_struct s;
            };

(from "info gcc" -> "C Extensions" -> "Type Attributes").


Marko

gcc does support #pragma pack:

http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html

James


Reply via email to