Differences between rel1 and rel3

Jason Perry jperry at hanover-square.freeserve.co.uk
Sun Sep 7 12:18:22 PDT 2003

Hi there,

I have a piece of code which works fine when built with GCC rel1 but
fails when built with GCC rel3.

The reason is because of the way structures are packed is handled
differently between the two versions e.g.

struct data_desc {
  u_int8_t  Length;
  u_int8_t  Type;
  u_int16_t version;
  u_int8_t  CountryCode;
  u_int8_t  Number;

Under rel1, sizeof() reports six, but with rel3 it reports 20 presumably
because it is now allocating 4 bytes per member in memory.

I was wondering if there is a compiler switch or #pragma which would
make rel3 behave like rel1 in this respect as this is causing having in
a piece of code that otherwise works fine.

Thanks in advance for any assistance.

Jason Perry
Please note: This address filters out non-plain text emails

More information about the gcc mailing list