long int / int assignment warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

my g++ is
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)

-Wconversion will issue a warning for the second cout line

Is there a compiler flag to force a warning for the first cout line?

------------------------------------
// compile with -std=c++11 -Wconversion
#include <iostream>
#include <cstdint>
int main()
{
    { int32_t x = 1; int64_t y = x; std::cout << y << std::endl; }
    { int64_t x = 2; int32_t y = x; std::cout << y << std::endl; }
    return 0;
}
-------------------------------------

Andre




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux