Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: DFS 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: References: <868qp1ra5f.fsf@linuxsc.com> <864izpr3nk.fsf@linuxsc.com> 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: 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 > 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.