Deutsch   English   Français   Italiano  
<vsjlcp$230a5$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: "A diagram of C23 basic types"
Date: Wed, 2 Apr 2025 16:33:46 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <vsjlcp$230a5$1@dont-email.me>
References: <87y0wjaysg.fsf@gmail.com> <vsj1m8$1f8h2$1@dont-email.me>
 <vsj2l9$1j0as$1@dont-email.me> <vsjef3$1u4nk$1@dont-email.me>
 <vsjg6t$20pdb$1@dont-email.me> <vsjgjn$1v1n4$1@dont-email.me>
 <vsjk4k$24q5m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 02 Apr 2025 17:33:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6ec1d618f3662fc028ed5e5779922e31";
	logging-data="2195781"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1937Wp2C2sVHgP2P3ooIP76"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zyBfYINsy7dPEYGnC7hgXuly3yQ=
In-Reply-To: <vsjk4k$24q5m$1@dont-email.me>
Content-Language: en-GB
Bytes: 2690

On 02/04/2025 16:12, Muttley@DastardlyHQ.org wrote:
> On Wed, 2 Apr 2025 11:12:07 -0300
> Thiago Adams <thiago.adams@gmail.com> wibbled:
>> Em 4/2/2025 11:05 AM, Muttley@DastardlyHQ.org escreveu:
>>> So what exactly is better / faster / clearer / safer in C23?
>>
>> We already had some C23 topics here.
>> My list
>>
>>   - #warning (better)
>>   - typeof/auto (better only when strictly necessary)
> 
> Auto as per C++ where its used as a substitute for unknown/long winded
> templated types or in range based loops? C doesn't have those so there's no
> reason to have it. If you don't know what type you're dealing with in C then
> you'll soon be up poo creek.
> 
>>   - digit separator (better, safer)
> 
> Meh.

What's the problem with it? Here, tell me at a glance the magnitude of 
this number:

     10000000000

You're either likely to get it wrong, or need to start counting digits. 
Here (not the same number) it's easier:

     100_000_000


> 
>>   - binary literal useful
> 
> We've had bitfields for years which cover most use cases.

Bitfields and binary literals are completely different things! A binary 
literal looks like this (if I got the prefix right):

      0b1_1101_1101         // the decimal value 447 or hex value 1DD
      0b11011101            // same thing without the separators

This is a bitfield, which can only appear inside a struct definition:

      int a:12;

The mystery is why it's taken half a century to standardise such literals.