This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60434] False -Wformat warnings about %lld and %Lf are given on Windows
- From: "egor_suvorov at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Mar 2014 08:52:15 +0000
- Subject: [Bug c++/60434] False -Wformat warnings about %lld and %Lf are given on Windows
- Auto-submitted: auto-generated
- References: <bug-60434-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60434
--- Comment #3 from Egor Suvorov <egor_suvorov at mail dot ru> ---
Yes, here is result both with C++03 and with C++11 (they're absolutely the
same):
a.cpp: In function 'int main()':
a.cpp:5:19: warning: format '%f' expects argument of type 'double', but
argument 2 has type 'long double' [-Wformat=]
printf("%f\n", x); // Undefined
^
a.cpp:6:20: warning: format '%lf' expects argument of type 'double', but
argument 2 has type 'long double' [-Wformat=]
printf("%lf\n", x); // Undefined
^
a.cpp:7:20: warning: unknown conversion type character 'L' in format
[-Wformat=]
printf("%Lf\n", x); // Expected '123.45' in C++11
^
a.cpp:7:20: warning: too many arguments for format [-Wformat-extra-args]
a.cpp:12:20: warning: unknown conversion type character 'L' in format
[-Wformat=]
printf("%Lf\n", y); // Undefined
^
a.cpp:12:20: warning: too many arguments for format [-Wformat-extra-args]