[cfe-dev] warnings about large negative integer values

Mansour Moufid mansourmoufid at gmail.com
Thu Feb 2 06:04:44 PST 2012


On Wed, Feb 1, 2012 at 3:33 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> Yes... that happens because "9223372036854775808L" doesn't fit into a
> signed long; "-9223372036854775808L" does, but the standard states
> that we aren't allowed to take that into account when we parse integer
> literals.
>
> The output happens to be the same for your testcase because
> 9223372036854775808UL happens to be the value you want, and it gets
> implicitly converted to a signed integer; it is possible to write
> testcases which would be affected by the difference.

Ah, I get it now. I'll use the (-LONG_MAX-1) construct from now on.

Thanks for the info.

Mansour



More information about the cfe-dev mailing list