Enable codebase-wide -Wshift-count-overflow warning#71
Closed
hebasto wants to merge 1 commit intobitcoin-core:masterfrom
Closed
Enable codebase-wide -Wshift-count-overflow warning#71hebasto wants to merge 1 commit intobitcoin-core:masterfrom
-Wshift-count-overflow warning#71hebasto wants to merge 1 commit intobitcoin-core:masterfrom
Conversation
The only line of code is guarded with `#pragma diagnostic ignored`.
Collaborator
Member
Author
|
Closing in favour of #74. |
sipa
added a commit
that referenced
this pull request
Apr 11, 2024
fe1040f Drop -Wno-shift-count-overflow compile flag (Pieter Wuille) 154bcd4 Avoid >> above type width in BitWriter (Pieter Wuille) Pull request description: For tiny fields (bits <= 8), the table type is `uint8_t`, which results in `BitWriter` using uint8_t logic as well. This is technically UB, as it performs right shifts of up to 8 positions. Avoid this by performing the BitWriter logic in either the table type, or `unsigned`, whichever is larger. This is an alternative to #71. ACKs for top commit: hebasto: re-ACK fe1040f. Only rebased since my [recent](#74 (review)) review. Tree-SHA512: fb41e125253d11f1662af77e9fc6e89ea7f4712f4fa5d500f483da3c6b325760d3ffedabedb7f15a7702223c86bc651b26004763e44c98d379cc2966ea0919a3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of disabling a compiler warning for the entire codebase, it is safer to disable it for a single line of code.