Re: g++ serious bug in Ubuntu Lucid Lynx

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

 



Christian Convey <christian.convey@xxxxxxxxx> writes:

>>>> Are you sure that's a bug in the legalistic sense?  IIRC, C and C++
>>>> don't promise any particular memory layout for structs.
>>>
>>> They don't promise any particular memory layout, but gcc does promise
>>> that it will not arbitrarily change the layout in new releases.  If it
>>> did, it would be impossible for code compiled by one version of gcc to
>>> call a function defined by a different version of gcc while passing a
>>> struct parameter.
>>>
>>> Ian
>>
>> 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.

No, within a single platform, it's a promise.  Processors have
specific written ABIs which describe, among other things, precisely
how struct fields are laid out in memory.

Ian



[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