"Pete" <yo**************@spamsrus.co.uk> wrote in message
news:fo*******************@fe1.news.blueyonder.co. uk...
I'd like to have warnings for code like this:
void blah(char c) {}
int main() {
int a = 500;
blah(a); // want a warning here
char b = a; // warning here would be nice too
}
Can this be achieved via any trick of the language, or is it
compiler-specific?
Check your compiler's documentation. Warnings are usually configurable.
For example, g++ has a -W flag to control which warnings it displays.
Warnings for those implicit conversions are probably turned off because most
programmers find them annoying, distracting, and not helpful.
--
David Hilsee