summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottmg <scottmg@chromium.org>2014-09-09 06:14:49 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 13:20:23 +0000
commit4c2d33ac8c061cf27a594473d6f9a450ee6c3c89 (patch)
tree00b4cde80455a8faf2eee88a90447a1c8d7b9d7c
parent6b30e882803f34879eaf0b17f7d15bb8b3cfddb1 (diff)
downloadchromium_src-4c2d33ac8c061cf27a594473d6f9a450ee6c3c89.zip
chromium_src-4c2d33ac8c061cf27a594473d6f9a450ee6c3c89.tar.gz
chromium_src-4c2d33ac8c061cf27a594473d6f9a450ee6c3c89.tar.bz2
gn/linux: warnings as errors, turn on Wextra
Also remove a few redundant consts that result in warnings like: ../../content/common/cursors/webcursor_aurax11.cc:20:1: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers] const ui::PlatformCursor WebCursor::GetPlatformCursor() { ^~~~~~ TBR=davemoore@chromium.org,sadrul@chromium.org R=brettw@chromium.org, thakis@chromium.org,rch@chromium.org BUG=393046, 335824 Review URL: https://codereview.chromium.org/538333002 Cr-Commit-Position: refs/heads/master@{#293930}
-rw-r--r--ash/shelf/shelf_view.h2
-rw-r--r--build/config/compiler/BUILD.gn15
-rw-r--r--build/secondary/third_party/icu/BUILD.gn9
-rw-r--r--build/secondary/third_party/libsrtp/BUILD.gn3
-rw-r--r--chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h2
-rw-r--r--content/common/cursors/webcursor.h2
-rw-r--r--content/common/cursors/webcursor_aurawin.cc2
-rw-r--r--content/common/cursors/webcursor_aurax11.cc2
-rw-r--r--content/common/cursors/webcursor_ozone.cc2
-rw-r--r--net/tools/quic/quic_in_memory_cache.h2
-rw-r--r--ui/keyboard/keyboard_util.cc4
-rw-r--r--ui/keyboard/keyboard_util.h4
12 files changed, 24 insertions, 25 deletions
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index b37cc3e..4a5868c 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -133,7 +133,7 @@ class ASH_EXPORT ShelfView : public views::View,
virtual void EndDrag(bool cancel) OVERRIDE;
// Return the view model for test purposes.
- const views::ViewModel* const view_model_for_test() const {
+ const views::ViewModel* view_model_for_test() const {
return view_model_.get();
}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 59c4673..793ee6a 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -477,8 +477,6 @@ config("runtime_library") {
# Toggles between higher and lower warnings for code that is (or isn't)
# part of Chromium.
-# TODO: -Werror should always be on, independent of chromium_code
-# http://crbug.com/393046
config("chromium_code") {
if (is_win) {
cflags = [
@@ -487,6 +485,7 @@ config("chromium_code") {
} else {
cflags = [
"-Wall",
+ "-Wextra",
# GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
# so we specify it explicitly.
@@ -494,11 +493,6 @@ config("chromium_code") {
# http://code.google.com/p/chromium/issues/detail?id=90453
"-Wsign-compare",
]
- if (!is_linux) {
- # TODO: Add this unconditionally once linux builds without warnings with
- # clang in the gn build.
- cflags += [ "-Werror" ]
- }
# In Chromium code, we define __STDC_foo_MACROS in order to get the
# C99 macros on Mac and Linux.
@@ -506,12 +500,6 @@ config("chromium_code") {
"__STDC_CONSTANT_MACROS",
"__STDC_FORMAT_MACROS",
]
-
- # TODO(brettw) this should also be enabled on Linux but some files
- # currently fail.
- if (is_mac) {
- cflags += [ "-Wextra" ]
- }
}
}
config("no_chromium_code") {
@@ -664,6 +652,7 @@ config("default_warnings") {
cflags = [
# Enables.
"-Wendif-labels", # Weird old-style text after an #endif.
+ "-Werror", # Warnings as errors.
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
diff --git a/build/secondary/third_party/icu/BUILD.gn b/build/secondary/third_party/icu/BUILD.gn
index 4f7f088..1a21949 100644
--- a/build/secondary/third_party/icu/BUILD.gn
+++ b/build/secondary/third_party/icu/BUILD.gn
@@ -258,13 +258,20 @@ component("icui18n") {
configs += [ ":icu_code" ]
direct_dependent_configs = [ ":icu_config" ]
+ cflags = []
+ if (is_android || is_linux) {
+ cflags += [
+ # ICU uses its own deprecated functions.
+ "-Wno-deprecated-declarations",
+ ]
+ }
if (is_clang) {
# uspoof.h has a U_NAMESPACE_USE macro. That's a bug,
# the header should use U_NAMESPACE_BEGIN instead.
# http://bugs.icu-project.org/trac/ticket/9054
configs -= [ "//build/config/clang:extra_warnings" ]
- cflags = [
+ cflags += [
"-Wno-header-hygiene",
# Looks like a real issue, see http://crbug.com/114660
"-Wno-return-type-c-linkage",
diff --git a/build/secondary/third_party/libsrtp/BUILD.gn b/build/secondary/third_party/libsrtp/BUILD.gn
index 8787beb..cfcae79 100644
--- a/build/secondary/third_party/libsrtp/BUILD.gn
+++ b/build/secondary/third_party/libsrtp/BUILD.gn
@@ -212,6 +212,9 @@ if (use_system_libsrtp) {
if (is_android) {
defines = [ "HAVE_SYS_SOCKET_H" ]
}
+ if (is_clang) {
+ cflags = [ "-Wno-implicit-function-declaration" ]
+ }
}
executable("srtp_test_cipher_driver") {
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h
index 0612db3..ee0cf57 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h
@@ -26,7 +26,7 @@ class ChromeLauncherAppMenuItem {
const gfx::Image& icon() const { return icon_; }
// Returns true if a separator should be inserted before this item.
- const bool HasLeadingSeparator() const { return has_leading_separator_; }
+ bool HasLeadingSeparator() const { return has_leading_separator_; }
// Returns true if the item is active.
virtual bool IsActive() const;
diff --git a/content/common/cursors/webcursor.h b/content/common/cursors/webcursor.h
index 45cf9df..d53fbd0 100644
--- a/content/common/cursors/webcursor.h
+++ b/content/common/cursors/webcursor.h
@@ -104,7 +104,7 @@ class CONTENT_EXPORT WebCursor {
#endif
#if defined(USE_AURA)
- const ui::PlatformCursor GetPlatformCursor();
+ ui::PlatformCursor GetPlatformCursor();
// Updates |device_scale_factor_| and |rotation_| based on |display|.
void SetDisplayInfo(const gfx::Display& display);
diff --git a/content/common/cursors/webcursor_aurawin.cc b/content/common/cursors/webcursor_aurawin.cc
index 5f61ed7..15ae5b4 100644
--- a/content/common/cursors/webcursor_aurawin.cc
+++ b/content/common/cursors/webcursor_aurawin.cc
@@ -11,7 +11,7 @@
namespace content {
-const ui::PlatformCursor WebCursor::GetPlatformCursor() {
+ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (!IsCustom())
return LoadCursor(NULL, IDC_ARROW);
diff --git a/content/common/cursors/webcursor_aurax11.cc b/content/common/cursors/webcursor_aurax11.cc
index 91fc942b..dbd2b21 100644
--- a/content/common/cursors/webcursor_aurax11.cc
+++ b/content/common/cursors/webcursor_aurax11.cc
@@ -17,7 +17,7 @@
namespace content {
-const ui::PlatformCursor WebCursor::GetPlatformCursor() {
+ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (platform_cursor_)
return platform_cursor_;
diff --git a/content/common/cursors/webcursor_ozone.cc b/content/common/cursors/webcursor_ozone.cc
index fe3dbd9..39a356d 100644
--- a/content/common/cursors/webcursor_ozone.cc
+++ b/content/common/cursors/webcursor_ozone.cc
@@ -11,7 +11,7 @@
namespace content {
-const ui::PlatformCursor WebCursor::GetPlatformCursor() {
+ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (platform_cursor_)
return platform_cursor_;
diff --git a/net/tools/quic/quic_in_memory_cache.h b/net/tools/quic/quic_in_memory_cache.h
index be091d5..c4b858a 100644
--- a/net/tools/quic/quic_in_memory_cache.h
+++ b/net/tools/quic/quic_in_memory_cache.h
@@ -44,7 +44,7 @@ class QuicInMemoryCache {
Response() : response_type_(REGULAR_RESPONSE) {}
~Response() {}
- const SpecialResponseType response_type() const { return response_type_; }
+ SpecialResponseType response_type() const { return response_type_; }
const BalsaHeaders& headers() const { return headers_; }
const base::StringPiece body() const { return base::StringPiece(body_); }
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc
index 438b99c..188aa73 100644
--- a/ui/keyboard/keyboard_util.cc
+++ b/ui/keyboard/keyboard_util.cc
@@ -285,12 +285,12 @@ bool SendKeyEvent(const std::string type,
return true;
}
-const void MarkKeyboardLoadStarted() {
+void MarkKeyboardLoadStarted() {
if (!g_keyboard_load_time_start.Get().ToInternalValue())
g_keyboard_load_time_start.Get() = base::Time::Now();
}
-const void MarkKeyboardLoadFinished() {
+void MarkKeyboardLoadFinished() {
// Possible to get a load finished without a start if navigating directly to
// chrome://keyboard.
if (!g_keyboard_load_time_start.Get().ToInternalValue())
diff --git a/ui/keyboard/keyboard_util.h b/ui/keyboard/keyboard_util.h
index c2b31b8..59b2b24 100644
--- a/ui/keyboard/keyboard_util.h
+++ b/ui/keyboard/keyboard_util.h
@@ -128,11 +128,11 @@ KEYBOARD_EXPORT bool SendKeyEvent(std::string type,
// Marks that the keyboard load has started. This is used to measure the time it
// takes to fully load the keyboard. This should be called before
// MarkKeyboardLoadFinished.
-KEYBOARD_EXPORT const void MarkKeyboardLoadStarted();
+KEYBOARD_EXPORT void MarkKeyboardLoadStarted();
// Marks that the keyboard load has ended. This finishes measuring that the
// keyboard is loaded.
-KEYBOARD_EXPORT const void MarkKeyboardLoadFinished();
+KEYBOARD_EXPORT void MarkKeyboardLoadFinished();
// Get the list of keyboard resources. |size| is populated with the number of
// resources in the returned array.