| Deutsch English Français Italiano |
|
<vrf4kd$1fbpe$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: DFS <nospam@dfs.com>
Newsgroups: comp.lang.c
Subject: Re: Suggested method for returning a string from a C program?
Date: Wed, 19 Mar 2025 15:06:56 -0400
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <vrf4kd$1fbpe$1@dont-email.me>
References: <vrd77d$3nvtf$2@dont-email.me> <868qp1ra5f.fsf@linuxsc.com>
<vrdhok$47cb$2@dont-email.me> <864izpr3nk.fsf@linuxsc.com>
<vreuhk$1asii$3@dont-email.me> <vrevhq$15bib$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 19 Mar 2025 20:06:54 +0100 (CET)
Injection-Info: dont-email.me; posting-host="901d9964429cda711e0950a8728255b7";
logging-data="1552174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19czv7qzJkNNOCh6G0oQxC5"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:By9Mt1UmM5owXE5j5SEs7IhuRFY=
Content-Language: en-US
In-Reply-To: <vrevhq$15bib$1@dont-email.me>
On 3/19/2025 1:40 PM, James Kuyper wrote:
> On 3/19/25 13:23, DFS wrote:
> ...
>> int64_t n = 0, max = 0, thismax = 0;
> ...
>> printf("\nmax n = %lld reached at input = %d\n", max, input);
> ...
>> You'll get compilation warnings about the printf specifier used with
>> int64_t.
>
> Not if you use the correct specifier:
> #include <inttypes.h>
> printf("\nmax n = %" PRId64 " reached at input = %d\n", max, input);
I saw that online, but didn't want to add another include.
But it does make the code slightly more portable - with those changes
the code now compiles and runs cleanly under Windows tcc and Linux gcc.
Thanks.