libraw1394 struct layouts, i386 vs. x86_64

pds pds100 at gmail.com
Wed Jan 7 15:51:24 EST 2009


On Wed, 07 Jan 2009 15:14:20 -0500
"Michael ODonnell" <michael.odonnell at comcast.net> wrote:

> 
> 
> >> Googling "gcc pragma pack" yielded the following link which seems
> >> to explain it fairly well.
> >>
> >> http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html
> >
> >
> >Ha!  I was reading that very section in a freshly downloaded PDF
> 
> Dang - it looks like those pragma directives are for solving what
> is basically the opposite problem; it seems that they can only
> be used to force tighter packing while my situation calls for
> my structure members to essentially be packed "less tightly" and
> those pragmas appear to have no effect...   >-/
>  
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/

Mike,

It's been a while since I've used pragmas, from what I remember 
pragma pack x, forces the structure to start on boundary x.  Where x is
indicates the byte alignment.  1 = 8 bit (char), 2 is 16bit (short), 4
is 32bit (int), 8 is 64 bit (long long)boundary.  When I've needed to
know the exact layout or more likely trying to find structure
corruption due to over write; I start with 32 bit alignment and then
add dummy variables to force the internal structure alignment to be
either 32 or 64 bits.

-pete

 





More information about the gnhlug-discuss mailing list