[Issue 8929] long.min is a Voldemort literal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 13 22:59:11 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=8929

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |pro.mathias.lang at gmail.com
         Resolution|---                         |WONTFIX

--- Comment #9 from Mathias LANG <pro.mathias.lang at gmail.com> ---
Nowadays, the `L` suffix is not required anymore, so the following compiles
just fine:
```
static assert (long.min == -9223372036854775808);
```

I was about to say that we should fix this for C compatibility, but C has the
same issue, as Daniel pointed out:

```
int main ()
{
    long long a = -9223372036854775808LL;
    return 0;
}
```

```
foo.c:3:20: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned
      [-Wimplicitly-unsigned-literal]
    long long a = -9223372036854775808LL;
                   ^
1 warning generated.
```

This sounds like a good entry for a FAQ. Closing as WONTFIX.

--


More information about the Digitalmars-d-bugs mailing list