Re: Problem with alignment under Linux [SEC=UNCLASSIFIED]

"Axel Seibert" <[email protected]> Thu, 9 Feb 2012 12:45:02 +0100
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
Hi, Andrew!

Thanx for the quick answer.

> In the 32bit linux environment, which I would have expected to 
> include a 32bit binary on a 64bit kernel, 

yes, we are talking about 32bit binaries.

> So there has to be something in the C headers you're working from 
> that triggers 8 byte packing. I went back through the old thread,
>  but didn't see any reference to any actual structure/union 
> declarations as they appear in the C headers, so it would be useful 
> to know how this is being triggered.

I was under the impression that it might have to do with the inclusion of the
union, which brings the trouble.

Can you give me a hint what to search for in the header files? I've been
looking for pragma, pack, alignment, 32 and 64, so far with no success. I
could also include the header files in my email, but I guess, you don't want
to go through more than 340 KBs of header files...

> BTW, it seems to me that there's a bug in the fill_union() function 
> as I think the union as shown should be 8 bytes rather than the 16 
> bytes reported - I think the calculation of the delta  should be 
> something like
> 
> 	delta  = size % 8
> 	if delta:
> 		delta = 8 - delta
> 

OK, I will fix this in the program.

What else can I do to support?

Thanx,
Axel


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/