-
Notifications
You must be signed in to change notification settings - Fork 28
new arithmetic overflow rule #220
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
new arithmetic overflow rule #220
Conversation
✅ Deploy Preview for scrc-coding-guidelines ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
felix91gr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review. We have a meeting together now, so I'd better submit it right away.
|
@felix91gr please approve me sir I am ready to be merged |
|
@felix91gr please review me. i'm very sad and wished to be merged. |
|
@rcseacord there's a merge conflict. It seems to be pretty trivial from here, and Github offers to let me resolve it in the Web UI, but I'd rather you resolve them instead because I don't want to break your working copy |
fixed a bunch of small problems and started adding compliant solutions using saturation semantics
adding Wrapping<T> example
Revised guidelines on arithmetic overflow, emphasizing prevention and the use of explicit wrapping functions. Updated examples to reflect compliant practices with saturation semantics.
Co-authored-by: Félix Fischer <[email protected]>
Clarify guidelines on eliminating arithmetic overflow for various integer types.
Clarify behavior of arithmetic overflow in Rust.
aa88512 to
81e0d9e
Compare
Co-authored-by: Félix Fischer <[email protected]>
|
@felix91gr rebased, please review! |
felix91gr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a reasonable first review, I hope
Clarified behavior of arithmetic overflow in debug and release modes. Updated examples to emphasize the use of explicit wrapping and saturation semantics.
Co-authored-by: Félix Fischer <[email protected]>
Co-authored-by: Félix Fischer <[email protected]>
Co-authored-by: Félix Fischer <[email protected]>
Co-authored-by: Félix Fischer <[email protected]>
Co-authored-by: Félix Fischer <[email protected]>
PLeVasseur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @rcseacord
|
Reviewed in session 2025-12-03 |
* new arithmetic overflow rule * Update expressions.rst fixed a bunch of small problems and started adding compliant solutions using saturation semantics * Update expressions.rst adding Wrapping<T> example * Revise arithmetic overflow guidelines and examples Revised guidelines on arithmetic overflow, emphasizing prevention and the use of explicit wrapping functions. Updated examples to reflect compliant practices with saturation semantics. * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update expressions.rst to specify integer types for overflow Clarify guidelines on eliminating arithmetic overflow for various integer types. * Update guidelines on arithmetic overflow handling Clarify behavior of arithmetic overflow in Rust. * Clarify arithmetic overflow behavior in expressions.rst * rebase for fls errors * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Apply suggestion from @rcseacord * Clarify arithmetic overflow handling and examples Clarified behavior of arithmetic overflow in debug and release modes. Updated examples to emphasize the use of explicit wrapping and saturation semantics. * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update print statement format in Rust example * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update src/coding-guidelines/expressions.rst Co-authored-by: Félix Fischer <[email protected]> * Update expressions.rst --------- Co-authored-by: Félix Fischer <[email protected]>
added new arithmetic overflow rule covers the following two CERT rules
INT30-C. Ensure that unsigned integer operations do not wrap
INT32-C. Ensure that operations on signed integers do not result in overflow