Deutsch   English   Français   Italiano  
<vtrk73$19iev$1@dont-email.me>

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

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!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: Loops (was Re: do { quit; } else { })
Date: Thu, 17 Apr 2025 20:18:59 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <vtrk73$19iev$1@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <20250413072027.219@kylheku.com>
 <vtgpce$39229$1@dont-email.me> <vti2ki$g23v$1@dont-email.me>
 <vtin99$vu24$1@dont-email.me> <vtiuf0$18au8$1@dont-email.me>
 <vtj97r$1i3v3$1@dont-email.me> <vtl166$36p6b$1@dont-email.me>
 <vtlcg0$3f46a$2@dont-email.me> <20250415053852.166@kylheku.com>
 <vtm4ae$6d5j$1@dont-email.me> <H7yLP.2056536$OrR5.1414451@fx18.iad>
 <vtmgj8$g81k$1@dont-email.me> <vtnfjj$1gk91$1@dont-email.me>
 <vto4fu$23kmr$1@dont-email.me> <20250416142925.663@kylheku.com>
 <vtpbnm$357ma$2@dont-email.me> <20250416164536.110@kylheku.com>
 <vtpj5h$3duft$1@dont-email.me> <87ikn3zg18.fsf@nosuchdomain.example.com>
 <vtqnv9$hf83$1@dont-email.me> <87fri68w2c.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 17 Apr 2025 21:19:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4c8a6fcf63bfdc2f0026c4e2b7cdaca7";
	logging-data="1362399"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/LLKVn1xBm92l/Bc45+4AP"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:cT0XJr2GHUZLfz267f+E6fXBA2Y=
In-Reply-To: <87fri68w2c.fsf@nosuchdomain.example.com>
Content-Language: en-GB
Bytes: 3863

On 17/04/2025 19:47, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:

>> Or maybe you can tell me where I can buy a computer (not some board
>> with an embedded microcontroller) where a C compiler for it has an
>> 'int' type other than 32 bits (with either fewer bits, or more!).
> 
> Not the point.  It's about what "int" *means*.  It doesn't mean "a
> 32-bit integer".
> 
>> At present it only seems to bother you. Since if it REALLY bothered
>> anyone here, nobody would be using 'int'; they'd be using int32_t or
>> long, unless they're happy that their int values and intermediate
>> calculations would be using only 16 bits.
> 
> POSIX and Windows both guarantee that int is at least 32 bits wide, and
> it's perfectly reasonable to rely on those guarantees on those platforms.
> 
> It would be so easy for you to get this right, but you don't even
> acknowledge the possibility that I might have a valid point.


It's an obscure, pedantic point.

A better one is that if considering only Windows and POSIX (what about 
MacOS or Android?), then you admit int will be 32 bits (at least, but 
I'm not holding my breath for 64).

That means that if either of those OSes are implied, then we can assume 
that 'int' means a 32-byte to near 100% likelihood.

That saves thousands of posters having to qualify every reference to 
'int' with '[on POSIX or Windows]' or 'when it is exactly 32 bits'.

That would be ironic if they have been making that assumption in their 
source code for years and decades, where it would be critical, but are 
not allowed to do so on long-running Usenet discusssions where it 
doesn't really matter.

So, like you get tired of my keeping on defending my stances from 
attacks on multiple fronts, I get tired of having remember that some 
specialised hardware that runs C may have a 16-bit int or something 
equally unusual.

In that case, why don't I save time by stating:

* Whenever I mention 'int' type in the context of C, it means the
   32-bit type

* If I intend it to mean anything other than that, I will say so.