[Bug c/35649] New: Incorrect printf warning: expect double has float
6yxwfq202 at sneakemail dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 20 12:12:00 GMT 2008
With the -Wformat option The code
void foo( float a )
{
printf("%f",a);
}
give the warning:
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.
--
Summary: Incorrect printf warning: expect double has float
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: 6yxwfq202 at sneakemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35649
More information about the Gcc-bugs
mailing list