I am very surprised when I compile the following code without warning using g ++ 4.1.2 with -Wall -Wextra -Wconversion enabled.
I want g ++ to show me every warning in order to avoid potential harm. I have to stick with g ++ 4.1.2.
#include <stdint.h> #include <string> using namespace std; int main() { uint8_t u1=1; uint64_t u64=1000; string s1=""; u1=u64; // want warning here s1=u64; // want warning here s1=u1; }
c ++ g ++
lyman
source share