This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60434] False -Wformat warnings about %lld and %Lf are given on Windows


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]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]