Using Packed keywrd (need syntax)

hammr@my-deja.com hammr@my-deja.com
Thu Nov 18 09:02:00 GMT 1999


I am new to gcc and g++. I am using g++ currenlty and I am trying to
define some packed structures. In other compilers(Diab) I could simply
typedef as follows:
typedef struct packed {
  int a;
  char b;
  inc c;
} MyType;
or some variation thereof. g++ accepts this, but it thinks I'm defining
the type called 'packed'!

I searched the net and found this syntax for gcc,
typdef struct {
  int a;
  char b;
  inc c;
} MyType __attribute__((packed));
which my g++ compiler simply rejects.

What is the proper syntax? Are pragmas required as well? I'd prefer not
to use any pragmas.
--
That was, without a doubt, my opinion.


Sent via Deja.com http://www.deja.com/
Before you buy.


More information about the Gcc-help mailing list