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

Warning compiling Protobuf 3.17 with clang++11 #8612

Closed
gvollant opened this issue May 13, 2021 · 2 comments · Fixed by #8664
Closed

Warning compiling Protobuf 3.17 with clang++11 #8612

gvollant opened this issue May 13, 2021 · 2 comments · Fixed by #8664

Comments

@gvollant
Copy link
Contributor

On v3.17.0, compiling C++ with clang11 using cmake

Compiler is installed using https://apt.llvm.org/ on Debian 10 AMD64

In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:50:8: warning: 'GeneratePrivateMembers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GeneratePrivateMembers(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:83:16: note: overridden virtual function is here
  virtual void GeneratePrivateMembers(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:51:8: warning: 'GenerateAccessorDeclarations' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateAccessorDeclarations(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:92:16: note: overridden virtual function is here
  virtual void GenerateAccessorDeclarations(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:52:8: warning: 'GenerateInlineAccessorDefinitions' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateInlineAccessorDefinitions(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:96:16: note: overridden virtual function is here
  virtual void GenerateInlineAccessorDefinitions(
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:53:8: warning: 'GenerateClearingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateClearingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:117:16: note: overridden virtual function is here
  virtual void GenerateClearingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:54:8: warning: 'GenerateMergingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateMergingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:136:16: note: overridden virtual function is here
  virtual void GenerateMergingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:55:8: warning: 'GenerateSwappingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateSwappingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:146:16: note: overridden virtual function is here
  virtual void GenerateSwappingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:56:8: warning: 'GenerateConstructorCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateConstructorCode(io::Printer* printer) const {}
       ^
./google/protobuf/compiler/cpp/cpp_field.h:151:16: note: overridden virtual function is here
  virtual void GenerateConstructorCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:57:8: warning: 'GenerateCopyConstructorCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateCopyConstructorCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:139:16: note: overridden virtual function is here
  virtual void GenerateCopyConstructorCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:58:8: warning: 'GenerateSerializeWithCachedSizesToArray' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:177:16: note: overridden virtual function is here
  virtual void GenerateSerializeWithCachedSizesToArray(
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:59:8: warning: 'GenerateByteSize' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateByteSize(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:182:16: note: overridden virtual function is here
  virtual void GenerateByteSize(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_field.cc:46:
./google/protobuf/compiler/cpp/cpp_map_field.h:60:8: warning: 'GenerateConstinitInitializer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateConstinitInitializer(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:172:16: note: overridden virtual function is here
  virtual void GenerateConstinitInitializer(io::Printer* printer) const {}
               ^
11 warnings generated.
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:50:8: warning: 'GeneratePrivateMembers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GeneratePrivateMembers(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:83:16: note: overridden virtual function is here
  virtual void GeneratePrivateMembers(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:51:8: warning: 'GenerateAccessorDeclarations' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateAccessorDeclarations(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:92:16: note: overridden virtual function is here
  virtual void GenerateAccessorDeclarations(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:52:8: warning: 'GenerateInlineAccessorDefinitions' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateInlineAccessorDefinitions(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:96:16: note: overridden virtual function is here
  virtual void GenerateInlineAccessorDefinitions(
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:53:8: warning: 'GenerateClearingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateClearingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:117:16: note: overridden virtual function is here
  virtual void GenerateClearingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:54:8: warning: 'GenerateMergingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateMergingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:136:16: note: overridden virtual function is here
  virtual void GenerateMergingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:55:8: warning: 'GenerateSwappingCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateSwappingCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:146:16: note: overridden virtual function is here
  virtual void GenerateSwappingCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:56:8: warning: 'GenerateConstructorCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateConstructorCode(io::Printer* printer) const {}
       ^
./google/protobuf/compiler/cpp/cpp_field.h:151:16: note: overridden virtual function is here
  virtual void GenerateConstructorCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:57:8: warning: 'GenerateCopyConstructorCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateCopyConstructorCode(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:139:16: note: overridden virtual function is here
  virtual void GenerateCopyConstructorCode(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:58:8: warning: 'GenerateSerializeWithCachedSizesToArray' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:177:16: note: overridden virtual function is here
  virtual void GenerateSerializeWithCachedSizesToArray(
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:59:8: warning: 'GenerateByteSize' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateByteSize(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:182:16: note: overridden virtual function is here
  virtual void GenerateByteSize(io::Printer* printer) const = 0;
               ^
In file included from google/protobuf/compiler/cpp/cpp_map_field.cc:31:
./google/protobuf/compiler/cpp/cpp_map_field.h:60:8: warning: 'GenerateConstinitInitializer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void GenerateConstinitInitializer(io::Printer* printer) const;
       ^
./google/protobuf/compiler/cpp/cpp_field.h:172:16: note: overridden virtual function is here
  virtual void GenerateConstinitInitializer(io::Printer* printer) const {}
               ^
google/protobuf/compiler/cpp/cpp_helpers.cc:173:6: warning: function 'Base63Char' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char Base63Char(int value) {
     ^
11 warnings generated.
1 warning generated.
In file included from google/protobuf/compiler/java/java_file.cc:46:
./google/protobuf/compiler/java/java_message.h:105:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:106:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:107:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:108:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:112:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
In file included from google/protobuf/compiler/java/java_message.cc:35:
./google/protobuf/compiler/java/java_message.h:105:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:106:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:107:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:108:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:112:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
In file included from ./google/protobuf/compiler/java/java_message_lite.h:41:
./google/protobuf/compiler/java/java_message.h:105:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:106:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:107:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:108:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:112:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
./google/protobuf/compiler/java/java_message_lite.h:53:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
./google/protobuf/compiler/java/java_message_lite.h:54:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
./google/protobuf/compiler/java/java_message_lite.h:55:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
./google/protobuf/compiler/java/java_message_lite.h:56:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
In file included from google/protobuf/compiler/java/java_message_lite.cc:35:
./google/protobuf/compiler/java/java_message_lite.h:58:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:41:
./google/protobuf/compiler/java/java_message.h:105:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:106:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:107:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
./google/protobuf/compiler/java/java_message.h:108:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:112:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:42:
./google/protobuf/compiler/java/java_message_lite.h:53:16: warning: 'Generate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void Generate(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:79:16: note: overridden virtual function is here
  virtual void Generate(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:42:
./google/protobuf/compiler/java/java_message_lite.h:54:16: warning: 'GenerateInterface' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateInterface(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:83:16: note: overridden virtual function is here
  virtual void GenerateInterface(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:42:
./google/protobuf/compiler/java/java_message_lite.h:55:16: warning: 'GenerateExtensionRegistrationCode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer);
               ^
./google/protobuf/compiler/java/java_message.h:87:16: note: overridden virtual function is here
  virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0;
               ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:42:
./google/protobuf/compiler/java/java_message_lite.h:56:16: warning: 'GenerateStaticVariables' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
./google/protobuf/compiler/java/java_message.h:71:16: note: overridden virtual function is here
  virtual void GenerateStaticVariables(io::Printer* printer,
               ^
In file included from google/protobuf/compiler/java/java_generator_factory.cc:42:
./google/protobuf/compiler/java/java_message_lite.h:58:15: warning: 'GenerateStaticVariableInitializers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  virtual int GenerateStaticVariableInitializers(io::Printer* printer);
              ^
./google/protobuf/compiler/java/java_message.h:76:15: note: overridden virtual function is here
  virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0;
              ^
10 warnings generated.
10 warnings generated.
5 warnings generated.
5 warnings generated.
google/protobuf/compiler/js/js_generator.cc:97:6: warning: unused function 'StrEndsWith' [-Wunused-function]
bool StrEndsWith(StringPiece sp, StringPiece x) {
     ^
1 warning generated.
In file included from google/protobuf/compiler/csharp/csharp_source_generator_base.cc:39:
./google/protobuf/compiler/csharp/csharp_source_generator_base.h:62:25: warning: private field 'descriptor_' is not used [-Wunused-private-field]
  const FileDescriptor* descriptor_;
                        ^
@haberman
Copy link
Member

Those -Winconsistent-missing-override warnings are pretty simple to fix, would you mind sending a PR for it?

Kernald added a commit to Kernald/protobuf that referenced this issue 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 protocolbuffers#8612.
@Kernald
Copy link
Contributor

Kernald commented May 27, 2021

#8664 should fix those (and some other warnings raised by clang 11).

Kernald added a commit to Kernald/protobuf that referenced this issue 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 protocolbuffers#8612.

release notes: no - no functionnal changes
Kernald added a commit to Kernald/protobuf that referenced this issue May 31, 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 protocolbuffers#8612.

release notes: no - no functionnal changes
Kernald added a commit to Kernald/protobuf that referenced this issue Jun 2, 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 protocolbuffers#8612.
acozzette pushed a commit that referenced this issue Jun 7, 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 #8612.
kspinka added a commit to kspinka/protobuf that referenced this issue Jun 12, 2021
This should conclude the larger efforts from issue protocolbuffers#8612
regarding clang warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants