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: How to fix: [-Wformat-nonliteral] Date: Mon, 17 Apr 2017 15:02:34 -0700 Organization: None to speak of Lines: 42 Message-ID: References: <87mvbsv0tq.fsf@bsb.me.uk> <87h920ukud.fsf@bsb.me.uk> <4f2b7ab6-2fa0-4fc9-aea2-7912adf068b5@googlegroups.com> <2937e657-8cbe-40ad-a526-978b29bd9247@googlegroups.com> <45db5042-80fe-4900-9724-1bf2e3f7092c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6ede04a56392f1431524e35eef643cab"; logging-data="29901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rc6mAbx5r/JimUZj8rpzo" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:GqXKEk05w6a1TFbYXsxm/MKQuoc= sha1:N0WiZzkAguSqiVwwUQhnB0NHYxY= Xref: csiph.com comp.lang.c:108255 David Brown writes: > On 17/04/17 20:54, Keith Thompson wrote: >> David Brown writes: >>> On 13/04/17 17:43, Keith Thompson wrote: >> [...] >>>> And if you make double 32 bits, what about long double? >>> >>> Typically, it is non-existant. There are a good many embedded >>> development tools where the support for C99 is limited, and this is a >>> common limitation. >> >> This isn't the first time I've seen the incorrect idea that long double >> was added in C99. In fact it existed in C89/C90. (C99 did add >> functions for float and long double; C90's only provided >> functions for double.) The ANSI C Rationale mentions "long double" as a >> new type. > > Really? That is news to me - but then, I come here to learn! > > The only compilers I have used that have supported long double have been > those with good C99 support (like gcc, Code Warrior, Green Hills, and a > few others) - while those with little or no C99 support invariably have > no long doubles either. Type long double has exactly the same minimum requirements as double, so any compiler that *correctly* supports double can support long double without much extra effort. But for a non-conforming compiler that provides a narrower representation for double, supporting long double would not add much value. >> Still, dropping long double for a *non-conforming* compiler for a small >> embedded system is likely to be a good idea. > > Indeed. For most tools for small microcontrollers, that sort of > non-conformity is to be expected. And no one (or very few people) are > going to miss long double support on their 8 bit microcontrollers. -- 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"