Skip to content

Commit

Permalink
third_party/googletest: Disable -Wconversion
Browse files Browse the repository at this point in the history
GoogleTest does not compile with -Wconversion, so disable it.

Example error:

  ../third_party/googletest/googletest/include/gtest/gtest-printers.h:531:9: error: implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision [-Werror,-Wimplicit-int-float-conversion]
      if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6;

Bug: b/262281394, b/259746255
Change-Id: Ib775b1081b7132c31bfb08fa5593cb5dfa719cd7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/124910
Reviewed-by: Sergio Soares <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
Reviewed-by: Alexei Frolov <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Jan 4, 2023
1 parent 0bf36e5 commit 72b5d42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion third_party/googletest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ if (dir_pw_third_party_googletest != "") {
]

# Fix some compiler warnings.
cflags = [ "-Wno-undef" ]
cflags = [
"-Wno-undef",
"-Wno-conversion",
]
}

pw_source_set("googletest") {
Expand Down

0 comments on commit 72b5d42

Please sign in to comment.