I'm quite surprised when I compile the following code without any warning using g++ 4.1.2 with -Wall -Wextra -Wconversion enabled.
I want g++ to show me every warning to avoid potential harm. I have to stick to 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; }
stringhasoperator=(char).-Wsign-conversion. I think it's time for-Wall-but-this-time-for-real. O my.