Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings raised by clang 11 #8664

Merged
merged 1 commit into from Jun 7, 2021

Conversation

Kernald
Copy link
Contributor

@Kernald Kernald commented May 27, 2021

This fixes a few kinds of warnings:

  • inconsistent-missing-override when the overriding site is missing the
    override keyword
  • unused-function when a function is neither visible nor used
  • unused-private-field when a private field exists but is never used
  • sign-compare when unsigned ints are compared to signed ints. Not all
    of those have been addressed, but this warning isn't enabled by
    default.

This fixes #8580, fixes #8612.

Copy link
Member

@acozzette acozzette left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup! Looks good to me except for a few more small comments I made.

src/google/protobuf/compiler/importer.cc Outdated Show resolved Hide resolved
src/google/protobuf/stubs/stringprintf.cc Outdated Show resolved Hide resolved
src/google/protobuf/util/field_mask_util.cc Outdated Show resolved Hide resolved
Copy link
Member

@acozzette acozzette left a comment

Choose a reason for hiding this comment

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

Sorry but I added just two more things I might missed before, otherwise looks great.

src/google/protobuf/util/field_mask_util.cc Outdated Show resolved Hide resolved
src/google/protobuf/util/field_mask_util.cc Outdated Show resolved Hide resolved
This fixes a few kinds of warnings:
 - inconsistent-missing-override when the overriding site is missing the
   override keyword
 - unused-function when a function is neither visible nor used
 - unused-private-field when a private field exists but is never used
 - sign-compare when unsigned ints are compared to signed ints. Not all
   of those have been addressed, but this warning isn't enabled by
   default.

This fixes protocolbuffers#8612.
@Kernald
Copy link
Contributor Author

Kernald commented Jun 2, 2021

I just addressed the last comments and rebased on master.

@acozzette acozzette merged commit 4644980 into protocolbuffers:master Jun 7, 2021
@Kernald Kernald deleted the llvm-warning-fixes branch June 8, 2021 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning compiling Protobuf 3.17 with clang++11 compile warning Clang 11 on C++
4 participants