From 3420909bbb47d6e47d6c561cbcce06d056fdf0a3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 18 Mar 2016 09:00:33 -0700 Subject: Fix GCC build -Wno-sign-compare also for GCC. -Wno-error=strict-overflow to ignore the following warning. In file included from ../../third_party/pdfium/core/include/fpdfapi/cpdf_object.h:10:0, from ../../third_party/pdfium/core/include/fpdfapi/cpdf_stream.h:10, from ../../third_party/pdfium/core/include/fpdfapi/fpdf_resource.h:12, from ../../third_party/pdfium/core/fpdfapi/fpdf_font/font_int.h:13, from ../../third_party/pdfium/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp:7: ../../third_party/pdfium/core/include/fxcrt/fx_string.h: In function 'CFX_ByteString {anonymous}::CMap_GetString(const CFX_ByteStringC&)': ../../third_party/pdfium/core/include/fxcrt/fx_string.h:111:19: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] if (count < 0 || count > m_Length - index) { BUG=589724 TEST=build with GCC R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1785943002 . --- BUILD.gn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index b18c76eaaa..9f3b27e9bc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -65,10 +65,14 @@ config("pdfium_config") { ] } - if (is_clang) { + if (is_clang || is_posix) { # TODO(thestig): Fix all instances, remove this, pdfium:29 cflags += [ "-Wno-sign-compare" ] } + + if (is_posix && !is_clang) { # When GCC. + cflags += [ "-Wno-error=strict-overflow" ] + } } static_library("pdfium") { -- cgit v1.2.3