Re: g++ serious bug in Ubuntu Lucid Lynx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Convey wrote:
I always thought that structure layout conventions are plarform-wide
much like calling conventions. Otherwise, how can we link together
code compiled by different compilers?


My impression is that it works more by luck and convention, than by
any particular promise.  Of course it if didn't work out, people would
get fussy and the problem would get addressed one way or another.

It also may be one reason we don't see a lot of (or any?) structs show
up in operating system APIs.   But that's just speculation on my part.

The ia32 System V ABI may be found at:
http://www.sco.com/developers/devspecs/
I don't know if it's its official place of distribution.

The x86_64 ABI may be found at:
http://www.x86-64.org/documentation.html

Both documents explain alignment constraints of structures
for System V ABI conforming implementations.

Note that using "packed" renders your structures non-compatible
with the ABI. Better is, if you want a more or less portable
code, to read/save the structures with a dedicated code, that
manipulates internal representation of data with char * pointers,
manipulation which is well defined in the C99 standard (if I
understand it as it has to be understood).

Hope that helps,
Cédric.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux