tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc


From: Vincent Lefevre
Subject: Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc
Date: Tue, 18 Oct 2016 10:35:28 +0200
User-agent: Mutt/1.7.1-6816-vl-r91193 (2016-10-12)

On 2016-10-18 09:59:36 +0200, Daniel Glöckner wrote:
> On Tue, Oct 18, 2016 at 09:41:49AM +0200, Vincent Lefevre wrote:
> > AFAIK, both are correct.
> 
> It depends on the ABI. The ARM EABI defines those details in
> http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf
> section 7.1.7. But I don't know if we adhere to those rules when
> compiling for ARM.

"For the purposes of calculating the alignment of the aggregate the
type of the member shall be the Fundamental Data Type upon which the
bit-field is based.[1]

[1] The intent is to permit the C construct struct {int a:8; char b[7];}
to have size 8 and alignment 4."

Assuming that there are similar requirements for other architectures,
the behavior of GCC now makes sense to me.

-- 
Vincent Lefèvre <address@hidden> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]