-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
verbs: Bitwise flag values should be unsigned
Casting rules in C call for sign extension in a number of cases, so if a bitwise value has the high bit set, then it can become subtly corrupted if the value is carelessly casted to a larger type. eg: uint64_t val64 = (int32_t)(1ULL<<31); Gives 0xffffffff80000000 instead of 0x80000000 A trivial fix is to make all the storage for bitwise values unsigned. Since switching 'int' to 'unsigned int' is an ABI compatible change, just go ahead and switch all obvious cases. Signed-off-by: Jason Gunthorpe <[email protected]>
- Loading branch information
1 parent
76743d7
commit 8fe7f12
Showing
5 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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