Re: Off-topic

Systemkennung Linux (linux@mailhost.uni-koblenz.de)
Wed, 5 Mar 1997 03:02:20 +0100 (MET)


Hi,

> Anyone know how to get gcc to NOT pad structs?
> __atttribute__((aligned (1))) does NOT work. It insists upon aligning
> long-words to long-words boundaries. The problem is that a certain data
> element ___specified___ by someone else, MUST exist in a light-pipe packet
> EXACTLY where specified!

You can use the packed attribute:

struct foo
{
char a;
int x[2] __attribute__ ((packed));
};

See GCC docs.

Ralf