I
itroot
Hello,
how can i make g++ show me warning when such implicit casting occurs?
#include <iostream>
#include <string>
int main() {
int x=10;
std::string s;
s=x; // int implicitly assigned to char, then called
std::string:
perator=(char)
}
This piece of code really surprise me, and i'cant found how i can make
g++ warn me.
I want warning on each "narrowing" conversion as char c=(int)(2), etc.
Thanks.
how can i make g++ show me warning when such implicit casting occurs?
#include <iostream>
#include <string>
int main() {
int x=10;
std::string s;
s=x; // int implicitly assigned to char, then called
std::string:
}
This piece of code really surprise me, and i'cant found how i can make
g++ warn me.
I want warning on each "narrowing" conversion as char c=(int)(2), etc.
Thanks.