This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/46908] printf not handling printing of double correctly in certain cases
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 12 Dec 2010 17:32:28 +0000
- Subject: [Bug c/46908] printf not handling printing of double correctly in certain cases
- Auto-submitted: auto-generated
- References: <bug-46908-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46908
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2010-12-12 17:32:26 UTC ---
Use -Wall:
test.c:18: warning: format â%fâ expects type âdoubleâ, but argument 2 has type
âlong doubleâ
which means that %f is not for long double, you should use %Lf and it will
work.