[Issue 23173] "Error: signed integer overflow" for compiler generated string of `long.min`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 15 19:24:38 UTC 2022


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl
           Hardware|x86_64                      |All
            Summary|"Error: signed integer      |"Error: signed integer
                   |overflow" when mixing in a  |overflow" for compiler
                   |`long.min` assignment       |generated string of
                   |                            |`long.min`
                 OS|Linux                       |All

--- Comment #1 from Dennis <dkorpel at live.nl> ---
This is not related to mixin, it's how DMD converts the number to a string:

```D
pragma(msg, long(-9223372036854775808));
```

Prints `-9223372036854775808L`, with an L suffix. The problem is, the -
operator is not part of the integer literal, so it's lexing
`9223372036854775808L` which doesn't fit because L denotes a signed long.

--


More information about the Digitalmars-d-bugs mailing list