0

I try to compile gmock headers and get tons of warnings like:

/opt/foreign_components/gmock-1.7.0/fused-src/gtest/gtest.h:10298:40: warning: 'testing::internal::ParamIteratorInterface* testing::internal::ValuesInIteratorRangeGenerator::Iterator::Clone() const [with T = bool]' can be marked override [-Wsuggest-override]

I already include the gmock headers with -isystem as described here: How to suppress GCC warnings from library headers?

I compile with:

g++ -Wsuggest-override -I ../ -I ../../generic/ -isystem /opt/foreign_components/gmock-1.7.0/fused-src/gmock/ -isystem /opt/foreign_components/gmock-1.7.0/fused-src -g -Wall -pedantic -pthread -std=c++14 -O2 /opt/foreign_components/gmock-1.7.0/fused-src/gmock-gtest-all.cc -c -o build-ut-std-xsysg-nomemdbg-o2-dynamic-noncov//opt/foreign_components/gmock-1.7.0 /fused-src/gmock-gtest-all.o

How can I solve this issue?

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
Klaus
  • 24,205
  • 7
  • 58
  • 113
  • You could remove -Wsuggest-override option – lostbard Dec 06 '18 at 17:34
  • @lostbard: Yeah ;) OK, you are right. But I want to have all my sources compiled with -Wsuggest-override and only in the included system headers I did not want to see the warnings. – Klaus Dec 06 '18 at 17:38
  • How about using the #progma options mentioned from your link? – lostbard Dec 06 '18 at 17:42
  • @lostbard: the files are not under my control. If I could change them with pragma, I can also add the missing override itself. So problem here is that I have to compile the '*.cc' files from the gmock itself. – Klaus Dec 06 '18 at 17:44
  • without code changes to the code, the only method I believe is remove the warning flag – lostbard Dec 06 '18 at 17:47

0 Answers0