Solaris core dump with McMillan Installer

Gordon McMillan gmcm at hypernet.com
Thu Oct 25 17:46:44 CEST 2001


[Gordon] 
>> > So does anyone know what the worst case alignment rule is for
>> > structs? 

[Martin von Loewis]
> If you are talking about C structs, you should be aware that the
> layout varies from system to system; in particular, the internal
> padding may change.
> 
> So if you have a single worst-case alignment, the structure fields may
> still end up on the wrong positions on some systems.

Internal padding is not the issue - the struct is 4 ints, 2 chars, then
something defined as char[1], but which can be nearly any length. The first 
int tells me how long the "struct" really is. C lacks a term for such a
beast - maybe it could be called an implicitly-linked-list.
 
> On most systems requiring primitive types to be aligned, the alignment
> is 8 if they support a "double" type. On Ultra-SPARC, the worst-case
> alignment is 16, for the "long double" type.

I was going to guess 8, but I guess I better use 16.

- Gordon
 




More information about the Python-list mailing list