diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-19 14:56:23 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-20 13:50:52 +0100 |
commit | 044002a37b0e3528a2b10c4f49abc3b2e3b80890 (patch) | |
tree | bc99ae14160ff9249a821287549ee7010153824d | |
parent | 7abcffdb4f989b730fbf5bba382791142f2751b6 (diff) | |
download | qtwebengine-chromium-044002a37b0e3528a2b10c4f49abc3b2e3b80890.tar.gz |
Silence most warnings
Suppress and fix many clang, GCC and MSVC warnings
"cause the night is crap and full of warnings"
Change-Id: I09882f850bac97c04a3d772e5f6386ce896c57b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | chromium/base/bind_internal.h | 1 | ||||
-rw-r--r-- | chromium/base/callback_internal.cc | 1 | ||||
-rw-r--r-- | chromium/base/logging.h | 13 | ||||
-rw-r--r-- | chromium/build/config/compiler/BUILD.gn | 17 | ||||
-rw-r--r-- | chromium/content/common/input/event_with_latency_info.h | 3 | ||||
-rw-r--r-- | chromium/third_party/blink/renderer/core/dom/collection_index_cache.h | 3 | ||||
-rw-r--r-- | chromium/third_party/blink/renderer/platform/wtf/casting.h | 1 | ||||
-rwxr-xr-x | gn/build/gen.py | 3 |
8 files changed, 36 insertions, 6 deletions
diff --git a/chromium/base/bind_internal.h b/chromium/base/bind_internal.h index 728e93ee76c..273efa0674d 100644 --- a/chromium/base/bind_internal.h +++ b/chromium/base/bind_internal.h @@ -750,6 +750,7 @@ bool QueryCancellationTraitsImpl(BindStateBase::CancellationQueryMode mode, functor, std::get<indices>(bound_args)...); } NOTREACHED(); + return false; } // Relays |base| to corresponding CallbackCancellationTraits<>::Run(). Returns diff --git a/chromium/base/callback_internal.cc b/chromium/base/callback_internal.cc index 6a185d90929..d710682e1fa 100644 --- a/chromium/base/callback_internal.cc +++ b/chromium/base/callback_internal.cc @@ -21,6 +21,7 @@ bool QueryCancellationTraitsForNonCancellables( return true; } NOTREACHED(); + return false; } } // namespace diff --git a/chromium/base/logging.h b/chromium/base/logging.h index cd211590837..46a193ba7ae 100644 --- a/chromium/base/logging.h +++ b/chromium/base/logging.h @@ -688,6 +688,11 @@ class CheckOpResult { #endif // !(OFFICIAL_BUILD && NDEBUG) +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress" +#endif // __GNUC__ + // This formats a value for a failing CHECK_XX statement. Ordinarily, // it uses the definition for operator<<, with a few special cases below. template <typename T> @@ -723,6 +728,10 @@ MakeCheckOpValueString(std::ostream* os, const T& v) { (*os) << static_cast<typename std::underlying_type<T>::type>(v); } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + // We need an explicit overload for std::nullptr_t. BASE_EXPORT void MakeCheckOpValueString(std::ostream* os, std::nullptr_t p); @@ -771,13 +780,13 @@ std::string* MakeCheckOpString<std::string, std::string>( template <class t1, class t2> \ inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ const char* names) { \ - if (ANALYZER_ASSUME_TRUE(v1 op v2)) \ + if (!!ANALYZER_ASSUME_TRUE(v1 op v2)) \ return NULL; \ else \ return ::logging::MakeCheckOpString(v1, v2, names); \ } \ inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ - if (ANALYZER_ASSUME_TRUE(v1 op v2)) \ + if (!!ANALYZER_ASSUME_TRUE(v1 op v2)) \ return NULL; \ else \ return ::logging::MakeCheckOpString(v1, v2, names); \ diff --git a/chromium/build/config/compiler/BUILD.gn b/chromium/build/config/compiler/BUILD.gn index 483a55b2fc9..1fb0a84095e 100644 --- a/chromium/build/config/compiler/BUILD.gn +++ b/chromium/build/config/compiler/BUILD.gn @@ -319,11 +319,17 @@ config("compiler") { if (use_qt && is_clang) { cflags += [ + "-Wno-unknown-attributes", + "-Wno-unknown-pragmas", "-Wno-unknown-warning-option" ] + cflags_cc += [ + "-Wno-parentheses-equality", + "-Wno-tautological-compare" + ] } - if (is_clang && is_debug) { + if (is_clang && (is_debug || use_qt)) { # Allow comparing the address of references and 'this' against 0 # in debug builds. Technically, these can never be null in # well-defined C/C++ and Clang can optimize such checks away in @@ -1445,6 +1451,15 @@ config("default_warnings") { # comments # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61638 cflags += [ "-Wno-comments" ] + + # Disable a number of GCC warnings caused by a mix + # of Chromium and GCC bugs. + cflags += [ "-Wno-dangling-else" ] + cflags += [ "-Wno-packed-not-aligned" ] + cflags_cc += [ "-Wno-attributes" ] + cflags_cc += [ "-Wno-class-memaccess" ] + cflags_cc += [ "-Wno-subobject-linkage" ] + cflags_cc += [ "-Wno-invalid-offsetof" ] } } diff --git a/chromium/content/common/input/event_with_latency_info.h b/chromium/content/common/input/event_with_latency_info.h index 0b97bdd35ad..f2b9b95ae02 100644 --- a/chromium/content/common/input/event_with_latency_info.h +++ b/chromium/content/common/input/event_with_latency_info.h @@ -49,8 +49,9 @@ class EventWithLatencyInfo { void CoalesceWith(const EventWithLatencyInfo& other) { // |other| should be a newer event than |this|. - if (other.latency.trace_id() >= 0 && latency.trace_id() >= 0) + if (other.latency.trace_id() >= 0 && latency.trace_id() >= 0) { DCHECK_GT(other.latency.trace_id(), latency.trace_id()); + } // New events get coalesced into older events, and the newer timestamp // should always be preserved. diff --git a/chromium/third_party/blink/renderer/core/dom/collection_index_cache.h b/chromium/third_party/blink/renderer/core/dom/collection_index_cache.h index 7572bea8c29..8f74313f187 100644 --- a/chromium/third_party/blink/renderer/core/dom/collection_index_cache.h +++ b/chromium/third_party/blink/renderer/core/dom/collection_index_cache.h @@ -217,8 +217,9 @@ CollectionIndexCache<Collection, NodeType>::NodeAfterCachedNode( collection.TraverseForwardToOffset(index, *CachedNode(), current_index); if (!current_node) { // Did not find the node. On plus side, we now know the length. - if (IsCachedNodeCountValid()) + if (IsCachedNodeCountValid()) { DCHECK_EQ(current_index + 1, CachedNodeCount()); + } SetCachedNodeCount(current_index + 1); return nullptr; } diff --git a/chromium/third_party/blink/renderer/platform/wtf/casting.h b/chromium/third_party/blink/renderer/platform/wtf/casting.h index ee2873f573b..09951be05f6 100644 --- a/chromium/third_party/blink/renderer/platform/wtf/casting.h +++ b/chromium/third_party/blink/renderer/platform/wtf/casting.h @@ -57,6 +57,7 @@ struct DowncastTraits { template <typename U> static bool AllowFrom(const U&) { static_assert(sizeof(U) == 0, "no downcast traits specialization for T"); + return false; } }; diff --git a/gn/build/gen.py b/gn/build/gen.py index bbddb868ebd..87db4c26bcf 100755 --- a/gn/build/gen.py +++ b/gn/build/gen.py @@ -411,13 +411,14 @@ def WriteGNNinja(path, platform, host, options, linux_sysroot): '/FS', '/Gy', '/W4', - '/WX', '/Zi', '/wd4099', '/wd4100', '/wd4127', '/wd4244', '/wd4267', + '/wd4505', + '/wd4577', '/wd4838', '/wd4996', ]) |