Suppress modernize-use-integer-sign-comparison#4558
Conversation
|
Is this showing a lot of hits? Should we create a helper function for pre-c++20 that makes those comparisons safer? |
See https://github.com/nlohmann/json/actions/runs/12396405659/job/34604358473?pr=4557. The first hit is this:
Yes, one approach could be to have our own implementation of cmp_equal, cmp_not_equal, cmp_less, cmp_greater, cmp_less_equal, and cmp_greater_equal and use it throughout. I would still like to merge this first, because all pipelines will fail now without suppressing this issue. Are you OK with this and having an issue to fix this in the future? |
|
Yeah, since all the current usages are safe, and the compiler is apparently looking right through the cast that we're using to make it "safe", then I think it's fine to log it for the future. Maybe we can use |
The
modernize-use-integer-sign-comparisonwas added to Clang-Tidy and is only applicable to C++20 code. Therefore, we suppress this check.