tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Bugs found in TCC


From: grischka
Subject: Re: [Tinycc-devel] Bugs found in TCC
Date: Tue, 26 Jan 2010 18:56:27 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Yann Bourrigault wrote:
.. For the moment I'll keep on working with the official release.

Sure.

Concerning this example, there is actually no clear statement in the C99 norm. 
My guess is that the size of the original type in which a bit-field is declared 
is only used to determine the alignment of the structure. In fact, some 
compilers allow to declare bit-fields with types smaller than int, which 
enables to have a different alignment for the structure. Considering promotion, 
the bit-field size should be taken as the actual type size, meaning that ufield 
must be considered as an uint7 instead of an uint32.
Thus, the rule "If an int can represent all values of the original type, the value 
is converted to an int." applies. Indeed, all the values stored in a uint7 may be 
stored in an int32, so the promotion is made on int.

Okay.

Actually the MS compilers seem to have a different notion of this (that
is the same as tcc, currently) but I think we are safe to assume that
gcc is right ;)

--- grischka





reply via email to

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