[Issue 24879] Unexpected sign extension after shifting a ubyte and promoting to ulong

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 25 10:46:15 UTC 2024


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl
            Summary|Weird bug...                |Unexpected sign extension
                   |                            |after shifting a ubyte and
                   |                            |promoting to ulong
           Severity|normal                      |enhancement

--- Comment #2 from Dennis <dkorpel at live.nl> ---
`bytes[4] << 24` gets promoted to int, and sign extended when or'd with a
ulong. The same happens in C, and D committed to having the same integer
promotion rules as C, so I don't see much that can be done here. Do you have a
suggestion?

--


More information about the Digitalmars-d-bugs mailing list