Skip to content

Add uint8_t static cast to avoid hicpp-signe-bitwise - #529

Merged
evaneschneider merged 6 commits into
devfrom
fix-frozen-key-hash
Aug 26, 2026
Merged

evaneschneider merged 6 commits into
devfrom
fix-frozen-key-hash

Conversation

@brantr

@brantr brantr commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

If key is used as a char or an element of string_view, it can be negative depending on its contents. To avoid hicpp-signe-bitwise in clang-tidy, it can be recast as a uint8_t. Closes #528.

If key is used as a char or an element of string_view, it can be negative depending on its contents.  To avoid hicpp-signe-bitwise in clang-tidy, it can be recast as a uint8_t.  Closes #528.
@brantr
brantr requested a review from mabruzzo July 15, 2026 18:04

@mabruzzo mabruzzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for making this PR!

I'm not sure that this actually supports unicode characters, but that shouldn't come up.1

Footnotes

  1. For some context, my concern is about C++ implementations where char is equivalent to signed char (the standard doesn't specify whether char is equivalent to signed char or unsigned char). It might work out (I'm not sure off the top of my head), but the safer thing to do is to use C++20's, std::bit_cast rather than a regular cast. This is all moot since we currently use C++17 and unicode probably won't come up. ↩

@evaneschneider
evaneschneider merged commit 5abd710 into dev Aug 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FrozenKeyIdxBiMap.h contains a signed integer operand with a binary bitwise operator

3 participants