Hello everyone,
consider the following code example:
Is there any way to make the compiler write a warning or an error, when an int is passed to a function which awaits an unsigned int? I tried some of the options gcc gives the user, but nothing worked for me.Code:void func(unsigned int _u) { //do a lot of stuff } int main() { int i = -1; func(i); return 0; }
I'm using gcc, version 4.1.3 20070929 on an Ubuntu system.