| Deutsch English Français Italiano |
|
<86wmcjmtcx.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: Suggested method for returning a string from a C program?
Date: Thu, 20 Mar 2025 11:47:58 -0700
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <86wmcjmtcx.fsf@linuxsc.com>
References: <vrd77d$3nvtf$2@dont-email.me> <868qp1ra5f.fsf@linuxsc.com> <vrdhok$47cb$2@dont-email.me> <20250319115550.0000676f@yahoo.com> <vreuj1$1asii$4@dont-email.me> <vreve4$19klp$2@dont-email.me> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> <vrh1br$35029$2@dont-email.me> <LRUCP.2$541.0@fx47.iad> <vrh71t$3be42$1@dont-email.me> <vrh9vh$3ev9o$1@dont-email.me> <20250320165914.000030eb@yahoo.com> <vrhbfl$3g9qg$1@dont-email.me> <20250320172922.00002a08@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Thu, 20 Mar 2025 19:47:58 +0100 (CET)
Injection-Info: dont-email.me; posting-host="7c01e97b5d1836204810413d59dbf156";
logging-data="3993682"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18L3l2OvOXcjbFQ9DGS7trHbd19K5q6b8A="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:+OzJhgsUsFK1pf2JaB9EVnJ4o2Q=
sha1:Moe5+AKG2yFAKQkI//97ak7N0nE=
Michael S <already5chosen@yahoo.com> writes:
> On Thu, 20 Mar 2025 15:16:05 -0000 (UTC)
> Muttley@DastardlyHQ.org wrote:
>
>> On Thu, 20 Mar 2025 16:59:14 +0200
>> Michael S <already5chosen@yahoo.com> wibbled:
>>
>>> On Thu, 20 Mar 2025 14:50:25 -0000 (UTC)
>>> Muttley@DastardlyHQ.org wrote:
>>>
>>>> What makes you think they're macros?
>>>
>>> PRIu64 and PRId64 are macros. They are ugly.
>>
>> Never even heard of them. Looking them up I can't see much use for
>> them frankly except if you're starting out on an unknown system and
>> can't find out the info any other way which would be ... odd.
>
> Then how exactly do you printf value of type int64_t in a code that
> expected to pass [gcc] compilation with no warnings on two platforms,
> one of which is 64-bit Unix/Linux and another is just about anything
> else?
If I needed to print such a value using printf(), I would most
likely do something like this:
typedef signed long long SLL;
typedef unsigned long long ULL;
...
printf( " the value of x64 is: %lld\n", (SLL){ x64 } );
and avoid the use of the <inttypes.h> macros altogether (not
to mention making the code more resilient against changes in
the type of x64).