Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:
[...]This is why it popular to just do:Is it? I don't recall seeing anyone other than you do that.
>
typedef long long int i64;
>
and to use %lld to print, and -LL on literals to force a 64-bit type.
I don't think so. They are add-ons that could have been created in user-code even prior to C99 (user-defined typedefs for 64 bits would 'need long long').stdint.h et al are just ungainly bolt-ons, not fully supported by theNo, they're fully supported by the language. They've been in the ISO
language.
standard since 1999.
I dislike it because this stuff it is not hard to do in a language with full support, but C always seems to make a dog's dinner of it:The problem with 'long' manifests itself there too, since on Linux,If you're writing code for which that's a problem, you probably need to
'int64_t' appears to be commonly defined on top of 'long' for 32-bit
systems, and 'long long' for 64-bit ones.
fix your code.
So somebody eschewing those ugly macros and using "%ld" to print anSomebody writing blatantly non-portable code will run into problems when
'int64_t' type, will find it doesn't work when run on a 64-bit system,
where "%lld" is needed. Same problem with using '1L' to define an
int64_t literal.
they try to port it.
I understand that you dislike <stdint.h>. That's both perfectly
acceptable and not very interesting.
Les messages affichés proviennent d'usenet.