"Integer value too large" warning

Started by ivmai, June 19, 2009, 01:47:11 PM

Previous topic - Next topic

ivmai

The following code produces the above warning (is it a feature or a bug?):

int main(void)
{
unsigned v = 0;
return v - (3 - 16);
}

AlexN

Quote from: ivmai on June 19, 2009, 01:47:11 PM
The following code produces the above warning (is it a feature or a bug?):

int main(void)
{
unsigned v = 0;
return v - (3 - 16);
}


I think, it is a feature. v is unsigned and you produce a negative value with is equal to a very big integer with is to long (1 bit to long) for a signed integer.
best regards
Alex ;)

Pelle

/Pelle