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: unassig...@gcc.gnu.org
        ReportedBy: joedoefawnb...@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.

Reply via email to