Warning fixes: unused member, cast, unused function#61
Merged
copybara-service[bot] merged 1 commit intodevfrom Feb 28, 2024
Merged
Warning fixes: unused member, cast, unused function#61copybara-service[bot] merged 1 commit intodevfrom
copybara-service[bot] merged 1 commit intodevfrom
Conversation
75fb3b3 to
8aebdd8
Compare
austinvhuang
approved these changes
Feb 28, 2024
| for (size_t layer_idx = 0; layer_idx < TConfig::kLayers; ++layer_idx) { | ||
| Layer<TConfig>* layer = weights ? &weights->layers[layer_idx] : nullptr; | ||
| CompressedLayer<TConfig>* c_layer = c_weights.CLayer(layer_idx); | ||
| for (int layer_idx = 0; layer_idx < static_cast<int>(TConfig::kLayers); |
Contributor
There was a problem hiding this comment.
what's the motivation here for having int layer_idx and a size_t idx vs the previous size_t layer_idx?
Member
There was a problem hiding this comment.
snprintf requires an int, but the two functions below want size_t. Making the loop counter size_t would require many casts, one per snprintf.
enum-class
reviewed
Feb 28, 2024
| class DistortionStats { | ||
| public: | ||
| void Notify(float original, float distorted) { | ||
| (void)padding_; // prevent unused member warning |
Contributor
There was a problem hiding this comment.
Maybe it would be better to use HWY_MAYBE_UNUSED
Member
There was a problem hiding this comment.
Unfortunately GCC seems to turn that into another warning:
class Test {
HWY_MAYBE_UNUSED int member;
};
<source>:11:26: warning: 'unused' attribute ignored [-Wattributes]
11 | HWY_MAYBE_UNUSED int member;
| ^~~~~~
PiperOrigin-RevId: 611074887
8aebdd8 to
272f17d
Compare
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.
Warning fixes: unused member, cast, unused function