This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mark.dickinson
收信人 Alexander.Belopolsky, MrJean1, ajaksu2, barry, benjamin.peterson, inducer, mark.dickinson, meador.inge, noufal, pitrou, teoliphant
日期 2010-05-20.18:50:02
SpamBayes Score 0.00013104774
Marked as misclassified
Message-id <1274381405.97.0.263467884633.issue3132@psf.upfronthosting.co.za>
In-reply-to
内容
> The C99 standard does not specify what the behavior should be.

Right;  it's down to the platform ABI.

I think the least common multiple of the alignment requirements of the struct members is the way to go, though.  It's difficult to imagine an ABI for which this lcm isn't the same thing as the largest struct member alignment, but I don't want to categorically say that such ABIs don't exist.

Here's a snippet from the gcc manual [1]:

"Note that the alignment of any given struct or union type is required by the ISO C standard to be at least a perfect multiple of the lowest common multiple of the alignments of all of the members of the struct or union in question."

I'm not sure I could identify the precise pieces of the standard that imply that requirement, though.

[1] http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Type-Attributes.html#Type-Attributes
历史
日期 用户 动作 参数
2010-05-20 18:50:06mark.dickinson修改recipients: + mark.dickinson, barry, teoliphant, pitrou, inducer, ajaksu2, MrJean1, benjamin.peterson, noufal, meador.inge, Alexander.Belopolsky
2010-05-20 18:50:05mark.dickinson修改messageid: <1274381405.97.0.263467884633.issue3132@psf.upfronthosting.co.za>
2010-05-20 18:50:03mark.dickinson链接issue3132 messages
2010-05-20 18:50:03mark.dickinson创建