-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Missing some warnings about "literal out of range for its type" #14165
Comments
This same logic applies to It is arguable as to whether these cases should produce an |
But
An appropriate warning for those would be something like "warning: casting a negative literal to an unsigned type". And this following case in my original post should clearly cause a
...given that the following does:
|
Saying Which is to say, Same thing with |
I suppose But the following is clearly an implicit cast, and thus should warrant a warning:
And the warning shouldn't be the |
Of course, I can only speculate. I didn't implement the lint. But my feeling is that |
Hi, I wrote the lint for the unsigned negation and wanted to catch the obvious cases negating unsigned literals. A related issue to the case @tommit mentioned is #5477. |
Duplicate of #5477. |
internal: Make CompletionItem more POD-like
The places I'd expect to get warnings are indicated by the comments in this example:
Here's the compiler output:
And here's the program output:
232, 232, 232, 232, 255, 1, 0
The text was updated successfully, but these errors were encountered: