This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52818] New: printf format %lf is erroneously rejected by C++11
- From: "joedoefawnbuck at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 01 Apr 2012 11:02:48 +0000
- Subject: [Bug c++/52818] New: printf format %lf is erroneously rejected by C++11
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52818
Bug #: 52818
Summary: printf format %lf is erroneously rejected by C++11
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: joedoefawnbuck@googlemail.com
C99, and thus C++11, allow %lf as a synonym for %f as a printf format
specifier. However, with `-pedantic -Wformat -std=c++11`, GCC 4.7. emits a
warning:
#include <cstdio>
int main() { return std::printf("%lf", 0.0); }
warning: ISO C++ does not support the â%lfâ gnu_printf format [-Wformat]
The same holds for -std=c99 and -std=c11.