Liste des Groupes | Revenir à c arch |
On 03/09/2024 22:22, MitchAlsup1 wrote:On 64-bit machines it re-establishes the dusty-deck old K&R C whereOn 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/.
Les messages affichés proviennent d'usenet.