Open Guolanlan opened 3 years ago
Add following to build/config/compiler/BUILD.gn
:
if (use_xcode_clang) {
# Range loop analysis is disabled by default in clang 12. But it's enabled
# by clang shipped with Xcode 12.
cflags += [ "-Wno-range-loop-analysis" ]
}
i use 4.2.x version, python2.7 scripts/build.py , to build, but problem,Is there a problem with the 4.2.x version?
../../third_party/abseil-cpp/absl/strings/str_cat.cc:142:32: error: loop variable 'piece' of type 'const absl::string_view' creates a copy from type 'const absl::string_view' [-Werror,-Wrange-loop-analysis] for (const absl::string_view piece : pieces) total_size += piece.size(); ^ ../../third_party/abseil-cpp/absl/strings/str_cat.cc:142:8: note: use reference type 'const absl::string_view &' to prevent copying for (const absl::string_view piece : pieces) total_size += piece.size(); ^
~~~~~~& ../../third_party/abseil-cpp/absl/strings/str_cat.cc:147:32: error: loop variable 'piece' of type 'const absl::string_view' creates a copy from type 'const absl::string_view' [-Werror,-Wrange-loop-analysis] for (const absl::string_view piece : pieces) { ^ ../../third_party/abseil-cpp/absl/strings/str_cat.cc:147:8: note: use reference type 'const absl::string_view &' to prevent copying for (const absl::string_view piece : pieces) { ^~~~~~~& ../../third_party/abseil-cpp/absl/strings/str_cat.cc:169:32: error: loop variable 'piece' of type 'const absl::string_view' creates a copy from type 'const absl::string_view' [-Werror,-Wrange-loop-analysis] for (const absl::string_view piece : pieces) { ^ ../../third_party/abseil-cpp/absl/strings/str_cat.cc:169:8: note: use reference type 'const absl::string_view &' to prevent copying for (const absl::string_view piece : pieces) { ^~~~~~~& ../../third_party/abseil-cpp/absl/strings/str_cat.cc:177:32: error: loop variable 'piece' of type 'const absl::string_view' creates a copy from type 'const absl::string_view' [-Werror,-Wrange-loop-analysis] for (const absl::string_view piece : pieces) { ^ ../../third_party/abseil-cpp/absl/strings/str_cat.cc:177:8: note: use reference type 'const absl::string_view &' to prevent copying for (const absl::string_view piece : pieces) { ^~~~~~~& 4 errors generated. [45/1871] CC obj/third_party/boringssl/boringssl/bio.o