avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] format '%5.2f' expects type 'double', but argument 6 has


From: Rick Mann
Subject: Re: [avr-chat] format '%5.2f' expects type 'double', but argument 6 has type 'float'
Date: Fri, 3 Feb 2012 00:16:57 -0800

I don't have the standard to check against, but there's no format specifier for 
double vs. float. %f and %g work for both (perhaps by promoting to double). I'd 
just like to get rid of the warning, which seems moot (since there's no 
alternative specifier, is there?).

If floats get promoted to double, it shouldn't bother warning, right?

-- 
Rick

On Feb 2, 2012, at 23:02 , Joerg Wunsch wrote:

> Rick Mann <address@hidden> wrote:
> 
>> I thought the %f specifier accepted double or float.
> 
> While it's in practice the same in AVR-GCC, formally, it doesn't.
> There is no output format specifier for `float', since it's impossible
> passing a float down to a vargs function (it will always be promoted
> to `double').
> 
> Reference: ISO/IEC 9899:1999, 7.19.6.1 The fprintf function
> 
> -- 
> cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL
> 
> http://www.sax.de/~joerg/                        NIC: JW11-RIPE
> Never trust an operating system you don't have sources for. ;-)
> 
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avr-chat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]