I have code using large integer literals:
if(nanoseconds < 1'000'000'000'000)
This gives a compiler warning integer constant is too large for 'long' type [-Wlong-long] . However, if I change it to:
if(nanoseconds < 1'000'000'000'000ll)
... Instead, I get a warning use of C++11 long long integer constant [-Wlong-long] .
I would like to disable this warning only for this line, but without disconnecting it for a long time or using -Wno-long-long for the whole project. I tried to surround him:
#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wlong-long" ... #pragma GCC diagnostic pop
but it doesn't seem to work with this warning. Is there anything else I can try?
I am -std=gnu++1z with -std=gnu++1z .
Edit: minimum comment example:
#include <iostream> auto main()->int { double nanoseconds = 10.0; if(nanoseconds < 1'000'000'000'000ll) { std::cout << "hello" << std::endl; } return EXIT_SUCCESS; }
Building with g++ -std=gnu++1z -Wlong-long test.cpp gives test.cpp:6:20: warning: use of C++11 long long integer constant [-Wlong-long]
I should mention this on a 32-bit Windows platform with MinGW-w64 (gcc 5.1.0) - the first warning does not appear on my 64-bit Linux systems, but the second (with ll suffix) appears on both.
source share