Skip to content

syntax errors for unsigned literals longer than 128 bits #11105

Closed
@ScottPJones

Description

If you have hexadecimal literal, normally it produces an unsigned value, whose size is dependent on the length of the literal.
However, if you go past 128 bits (32 hex digits), then it will switch to a signed number, which could possibly lead to hard to find bugs.
For example:

julia> ~0x00000000000000000000000000000000
0xffffffffffffffffffffffffffffffff

julia> ~0x000000000000000000000000000000000
-1

I believe this at least deserves a warning from the compiler (a point I tried to raise in #11081, only to have the title of my issue changed out from under me and then have it closed)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codeneeds decisionA decision on this change is neededparserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions