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.

@google-cla google-cla bot added the cla: yes label May 27, 2021
@acozzette acozzette added c++ release notes: yes Include this PR description in the next release kokoro:run labels May 27, 2021
@fowles fowles requested review from dlj-NaN and acozzette and removed request for dlj-NaN May 27, 2021
Copy link
Member

@acozzette acozzette left a comment

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

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
52 of 54 checks passed
@Kernald Kernald deleted the llvm-warning-fixes branch Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ cla: yes release notes: yes Include this PR description in the next release
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