Sujet : Re: Suggested method for returning a string from a C program?
De : Muttley (at) *nospam* DastardlyHQ.org
Groupes : comp.lang.cDate : 20. Mar 2025, 15:50:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrh9vh$3ev9o$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
On Thu, 20 Mar 2025 14:00:29 +0000
bart <
bc@freeuk.com> wibbled:
On 20/03/2025 13:36, Scott Lurndal wrote:
Using the defined width types is far better (e.g. uint64_t);
even if the standard allows the type to not exist on a particular
implementation. No useful implementation would fail to define
uint64_t in these modern times.
>
The point was made earlier on that int64_t types are awkward to work
with; they need that stdint.h header to even exist, and they need those
ugly macros in inttypes.h to print out their values.
I've never found them awkward to work with and every *nix I've ever developed
on had stdint.h. If Windows doesn't thats Window's problem.
This is why it popular to just do:
>
typedef long long int i64;
Popular maybe in WindowsWorld. Why as a unix dev would I do that when
standard typedefs already exist for this exact purpose?
stdint.h et al are just ungainly bolt-ons, not fully supported by the
language.
Whats that supposed to mean? The core language itself supports very little.
Do you not use libraries at all?
So somebody eschewing those ugly macros and using "%ld" to print an
What makes you think they're macros?
MacOS:
stdint.h
_types/_uint64_t.h
typedef unsigned long long uint64_t;
Linux:
stdint.h
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endif