Sujet : Re: Computer architects leaving Intel...
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.archDate : 04. Sep 2024, 08:29:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vb927t$3nlvo$5@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 03/09/2024 22:22, MitchAlsup1 wrote:
On Tue, 3 Sep 2024 19:30:21 +0000, Stefan Monnier wrote:
Specifications are an agreement between the supplier and the client. The
>
The problem here is that the C standard, seen as a contract, is unfair
to the programmer, because it's so excruciatingly hard to write code
that is guaranteed to be free from UB.
# define int int64_t
..
makes it easier.
That's UB, I believe :-) And it will certainly be confusing.
But good use of size-specific types is helpful to writing correct code. If your calculations could conceivably overflow 32 bits, int64_t is a good choice.
For smaller numbers and portable code, you might want int_fast32_t or int_fast16_t, which on most 64-bit systems will be faster than "int".
You can call it /ugly/, but it's not /hard/.