lkml.org 
[lkml]   [1997]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Off-topic
Date
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

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.076 / U:2.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site