Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: const and the C type system Date: Mon, 02 Oct 2017 12:37:33 -0700 Organization: None to speak of Lines: 46 Message-ID: References: <89577a10-c851-42ee-a68a-825a25baded0@googlegroups.com> <2c5a4b5b-ec8b-44fe-a77c-e26a0e1c5bb9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="6cf03bc409832187b50b684a697bfd95"; logging-data="14961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ee0T7rz8kopX9aXxEqe9n" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:UsuMkIWukOWGX2fVCIYK1NHiUjs= sha1:tJacPP/K/3dOHikb48PPk/TKroM= Xref: csiph.com comp.lang.c:120709 Ian Collins writes: > On 10/ 3/17 07:33 AM, bartc wrote: >> On 02/10/2017 17:40, Keith Thompson wrote: >>> bartc writes: >> >>>> If I specify this lot, it still says nothing about it >>>> (I've no idea what those format warnings are about): >> >>>> c:\c>\tdm\bin\gcc -O3 -std=c11 -Wall -Wextra -Wpedantic -c c.c >>>> >>>> c.c: In function 'main': >>>> c.c:14:10: warning: unknown conversion type character 'l' in format >>>> [-Wformat=] >>>> printf("d=%lld\n",d); >>>> ^ >>>> c.c:14:10: warning: too many arguments for format [-Wformat-extra-args] >> >>> That's weird. What version of gcc are you using ("gcc --version")? >>> >>> gcc 6.3.0 doesn't complain about the format strings. An very >>> old version of gcc might not recognize the "%lld" format, which >>> was introduced in C99, but then it shouldn't have recognized the >>> "-std=c11" option. >> >> It was version 5.1.0 (tdm for Windows). >> >> It can be reduced to this: >> >> printf("%lld",0LL); >> >> then 'gcc -Wall -c' says 'unknown conversion type character 'l' in format'. > > Could this be a consequence of a windows library not supporting %lld? Ah, that's a possibility, though it would be an indirect consequence. tdm-gcc is based on MinGW-w64 with some local patches. Either the tdm developers or the MinGW-w64 developers might have modified gcc to force it *not* to recognize "%lld". (If the library actually does support "%lld", then this is a bug but not a conformance issue.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"