Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integer literal specification and implementation differs #3980

Open
dlangBugzillaToGithub opened this issue Dec 14, 2019 · 4 comments
Open

Comments

@dlangBugzillaToGithub
Copy link

berni44 (@berni44) reported this on 2019-12-14T10:31:27Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=20449

CC List

Description

void main()
{
    auto x = 9223372036854775808; // long.max + 1
}

compilation fails, but specs on https://dlang.org/spec/lex.html#integerliteral tell, that it will not.

See https://forum.dlang.org/post/unesuebhxinmoqzhzhbb@forum.dlang.org
@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-12-14T21:25:56Z

@dkorpel updated dlang/dmd pull request #10673 "Fix 20449 - integer literal specification and implementation differs" fixing this issue:

- fix issue 20449 - integer literal specification and implementation differs

https://github.com/dlang/dmd/pull/10673

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 2019-12-16T07:29:47Z

Because it's been implemented this way for 19 years now, and the compiler behavior matches C, I recommend that the spec change rather than the compiler.

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 2019-12-16T07:46:52Z

I changed this to a spec bug, rather than a compiler bug.

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 2019-12-16T07:59:37Z

(In reply to Walter Bright from comment #3)
> I changed this to a spec bug, rather than a compiler bug.

Nitpicking, but: It was a spec bug from the very beginning and I was surprised to see an implementation fix PR...

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

No branches or pull requests

1 participant