C bitfields guarantees

Timon Gehr timon.gehr at gmx.ch
Sat Jul 6 15:54:49 UTC 2024


On 7/6/24 01:23, Walter Bright wrote:
> On 7/5/2024 10:02 AM, Timon Gehr wrote:
>> On 7/5/24 18:35, Walter Bright wrote:
>>>
>>> Consider also that the C standard does not specify the size of a 'char'.
>>
>> D does specify it.
> 
> Yes. And I have no concern at all about some C compiler that uses a 
> different size. None of those C compilers will compile "portable" C 
> code, either, even though the Standard permits such compilers.
> 
> If we go though a dimensional warp into an alternate universe, where C 
> chars are 9 bits, we'll change the D compiler to match.

The point was: D should actually specify more bitfield layout guarantees 
than the C standard.


More information about the Digitalmars-d mailing list