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

Literal overflow warnings should only apply to decimal. #23463

Closed
mahkoh opened this issue Mar 18, 2015 · 2 comments
Closed

Literal overflow warnings should only apply to decimal. #23463

mahkoh opened this issue Mar 18, 2015 · 2 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Mar 18, 2015

E.g. 0x8888i16 should not warn. Similar to binary operations | and &, hexadecimal, binary, and octal literals are often used to specify the concrete representation in memory whereas decimal literals are used to represent abstract values.

@pnkfelix @nikomatsakis

@theemathas
Copy link
Contributor

Also note that -(0x8000i16) which evaluates to -32768 (hex: 0x8000i16, which is the minimum value of i16) currently does not warn.

@theemathas
Copy link
Contributor

cc #22020

@steveklabnik steveklabnik added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Mar 18, 2015
@mahkoh mahkoh closed this as completed Apr 11, 2015
@rust-lang rust-lang locked and limited conversation to collaborators Apr 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

3 participants