[Issue 4491] Assigning large const value to ulong type results in "signed integer overflow"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 22 07:48:52 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4491



--- Comment #3 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-07-22 07:48:45 PDT ---
(In reply to comment #1)
> You need to add an 'L' suffix when it's larger than int.max, and a 'U' suffix
> when it's unsigned.
> 
> import std.stdio;
> void main()
> {
>     ulong t = 18446744073709551615UL;
>     printf("%llu\n", t);
> }
> 
> The error message should make this clearer. Marking as a 'diagnostic' bug.

I suppose that makes sense once you know. Though it seems that it should more
like syntactical sugar to me, rather than a mandatory marking.

For example, "1e6" gets translated to 1_000_000.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list