NO

Author Topic: "Integer value too large" warning  (Read 3246 times)

ivmai

  • Guest
"Integer value too large" warning
« 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);
}

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: "Integer value too large" warning
« Reply #1 on: June 19, 2009, 08:46:22 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 ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: "Integer value too large" warning
« Reply #2 on: June 21, 2009, 01:05:38 PM »
Works fine in v6.0
/Pelle