[Bug c/35649] Incorrect printf warning: expect double has float
wilson at tuliptree dot org
gcc-bugzilla@gcc.gnu.org
Sat Mar 22 02:14:00 GMT 2008
------- Comment #3 from wilson at tuliptree dot org 2008-03-22 02:13 -------
Subject: Re: New: Incorrect printf warning: expect double has
float
6yxwfq202 at sneakemail dot com wrote:
> foo.c:3: warning: format '%f' expects type 'double', but argument 2 has type
> 'float'
> I believe this is unnecessary because float is promoted to double in variadic
> functions.
Small 8/16 bit microprocessors often don't support all FP types.
h8300.h has for instance
#define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 32
So floats and doubles are the same thing, which is probably confusing
something in the C front end. Maybe a type conversion got optimized
away (folded?) because it was a no-op for instance. I haven't tried to
reproduce this.
Jim
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35649
More information about the Gcc-bugs
mailing list