Fix -Wsign-compare compiler warning#151
Closed
hebasto wants to merge 1 commit into
Closed
Conversation
-Wsign compiler warning-Wsign-compare compiler warning
ryanofsky
reviewed
Feb 4, 2025
Comment on lines
+633
to
634
| for (size_t i = 4; i < static_cast<size_t>(argc); ++i) { | ||
| KJ_IF_MAYBE(dir, fs->getRoot().tryOpenSubdir(cwd.evalNative(argv[i]))) { |
Collaborator
There was a problem hiding this comment.
In commit "Fix -Wsign-compare compiler warning" (7452ddd)
Is switching size_t on this line to int enough to fix the problem? It would seem better to avoid this error by using the same type consistently and avoiding the need to cast.
Collaborator
There was a problem hiding this comment.
re: #151 (comment)
Went ahead and made this change in #152 but did not confirm it fixes the warning (since I wasn't seeing the warning). If not, can use the fix here instead.
Member
Author
ryanofsky
added a commit
that referenced
this pull request
Feb 5, 2025
0b8b7f9 refactor: Fix `-Wsign-compare` compiler warning (Hennadii Stepanov) a02c079 clang-tidy: Suppress `performance-enum-size` check warning (Hennadii Stepanov) 593807a clang-tidy: Fix `readability-container-size-empty` check (Hennadii Stepanov) 68c1c6c clang-tidy: Fix `readability-avoid-return-with-void-value` check (Hennadii Stepanov) 4abaa98 clang-tidy: Fix `readability-avoid-nested-conditional-operator` check (Hennadii Stepanov) 01ef094 clang-tidy: Fix `performance-unnecessary-value-param` check (Hennadii Stepanov) c665a43 clang-tidy: Fix `misc-use-internal-linkage` check (Hennadii Stepanov) 15c77e9 clang-tidy: Fix `misc-include-cleaner` check (Hennadii Stepanov) 848c902 clang-tidy: Fix `misc-const-correctness` check (Hennadii Stepanov) 4a2508c clang-tidy: Fix `modernize-type-traits` check (Hennadii Stepanov) 8170d3d clang-tidy: Suppress `bugprone-empty-catch` check warning (Hennadii Stepanov) c068596 clang-tidy: Fix `bugprone-crtp-constructor-accessibility` check (Hennadii Stepanov) 00036c0 clang-tidy: Disable `performance-avoid-endl` check (Hennadii Stepanov) 359a615 clang-tidy: Disable `misc-use-anonymous-namespace` check (Hennadii Stepanov) Pull request description: Most of these changes are not my own. This is combination of commits from #144 and #151 which fix a variety of compiler warnings. Several of the fixes are just suppressions, so followups can be done to improve code and fix problems more completely. More details can be found in #144. Top commit has no ACKs. Tree-SHA512: 581720d357dce36553f91fb4bf92c4ade2c228ce199b342c28637f2615b22aa6e5908c83a698320438e5d53309581ec64410f469cbb782843970caee3c21d62e
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes bitcoin/bitcoin#30975 (comment):
This is the only warning when all default Bitcoin Core flags are applied.