This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/69605] New: printf %f on integers
- From: "elmerido at yopmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Feb 2016 20:40:54 +0000
- Subject: [Bug c/69605] New: printf %f on integers
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69605
Bug ID: 69605
Summary: printf %f on integers
Product: gcc
Version: 4.8.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: elmerido at yopmail dot com
Target Milestone: ---
#include<stdio.h>
int main() {
printf("a= %f \n",3.14);
printf("b= %f \n",200);
return 0;
}
returns :
a= 3.140000
b= 3.140000
Compilation gives warning but still generates the binary :
i.c: In function âmainâ:
i.c:6:2: warning: format â%fâ expects argument of type âdoubleâ, but argument 2
has type âintâ [-Wformat=]
printf("b= %f \n",200);
^