Unsigned int can not be negative by default. The compiler generates a warning. That's ok. But it is not clear for me why it does not generate a warning when I do the same thing in a function with a negative default value.
unsigned int test(unsigned int i = -1) { return i;} // no warnings! Why?
int main()
{
   unsigned int i = -1;        // warning warning C4245 (ok!)
   unsigned int j = test();    // no warnings!  Why?     
}
 
     
     
    