Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/common.gypi ('k') | chrome/browser/policy/policy_path_parser_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/nacl/config.gni") 8 import("//build/config/nacl/config.gni")
9 import("//build/toolchain/ccache.gni") 9 import("//build/toolchain/ccache.gni")
10 10
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 "-Wno-microsoft-enum-value", # http://crbug.com/505296 776 "-Wno-microsoft-enum-value", # http://crbug.com/505296
777 "-Wno-unknown-pragmas", # http://crbug.com/505314 777 "-Wno-unknown-pragmas", # http://crbug.com/505314
778 "-Wno-microsoft-cast", # http://crbug.com/550065 778 "-Wno-microsoft-cast", # http://crbug.com/550065
779 779
780 # Disable unused-value (crbug.com/505318) except -Wunused-result. 780 # Disable unused-value (crbug.com/505318) except -Wunused-result.
781 "-Wno-unused-value", 781 "-Wno-unused-value",
782 "-Wunused-result", 782 "-Wunused-result",
783 ] 783 ]
784 } 784 }
785 } else { 785 } else {
786 # Common GCC warning setup.
787 cflags += [
788 # Enables.
789 "-Wendif-labels", # Weird old-style text after an #endif.
790
791 # Disables.
792 "-Wno-missing-field-initializers", # "struct foo f = {0};"
793 "-Wno-unused-parameter", # Unused function parameters.
794 ]
795
796 if (treat_warnings_as_errors) { 786 if (treat_warnings_as_errors) {
797 cflags += [ "-Werror" ] 787 cflags += [ "-Werror" ]
798 } 788 }
799 789
800 if (is_mac) { 790 if (is_mac) {
801 cflags += [ "-Wnewline-eof" ] 791 cflags += [ "-Wnewline-eof" ]
802 if (!is_nacl) { 792 if (!is_nacl) {
803 # When compiling Objective-C, warns if a method is used whose 793 # When compiling Objective-C, warns if a method is used whose
804 # availability is newer than the deployment target. This is not 794 # availability is newer than the deployment target. This is not
805 # required when compiling Chrome for iOS. 795 # required when compiling Chrome for iOS.
(...skipping 21 matching lines...) Expand all
827 } 817 }
828 818
829 if (gcc_version >= 48) { 819 if (gcc_version >= 48) {
830 # Don't warn about the "typedef 'foo' locally defined but not used" 820 # Don't warn about the "typedef 'foo' locally defined but not used"
831 # for gcc 4.8. 821 # for gcc 4.8.
832 # TODO: remove this flag once all builds work. See crbug.com/227506 822 # TODO: remove this flag once all builds work. See crbug.com/227506
833 cflags += [ "-Wno-unused-local-typedefs" ] 823 cflags += [ "-Wno-unused-local-typedefs" ]
834 } 824 }
835 } 825 }
836 826
827 # Common Clang and GCC warning setup.
828 if (!is_win || is_clang) {
829 cflags += [
830 # Enables.
831 "-Wendif-labels", # Weird old-style text after an #endif.
832
833 # Disables.
834 "-Wno-missing-field-initializers", # "struct foo f = {0};"
835 "-Wno-unused-parameter", # Unused function parameters.
836 ]
837 }
838
837 if (is_clang) { 839 if (is_clang) {
838 cflags += [ 840 cflags += [
839 # This warns on using ints as initializers for floats in 841 # This warns on using ints as initializers for floats in
840 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), 842 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
841 # which happens in several places in chrome code. Not sure if 843 # which happens in several places in chrome code. Not sure if
842 # this is worth fixing. 844 # this is worth fixing.
843 "-Wno-c++11-narrowing", 845 "-Wno-c++11-narrowing",
844 846
845 # Warns on switches on enums that cover all enum values but 847 # Warns on switches on enums that cover all enum values but
846 # also contain a default: branch. Chrome is full of that. 848 # also contain a default: branch. Chrome is full of that.
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 if (symbol_level == 0) { 1315 if (symbol_level == 0) {
1314 configs = [ ":no_symbols" ] 1316 configs = [ ":no_symbols" ]
1315 } else if (symbol_level == 1) { 1317 } else if (symbol_level == 1) {
1316 configs = [ ":minimal_symbols" ] 1318 configs = [ ":minimal_symbols" ]
1317 } else if (symbol_level == 2) { 1319 } else if (symbol_level == 2) {
1318 configs = [ ":symbols" ] 1320 configs = [ ":symbols" ]
1319 } else { 1321 } else {
1320 assert(false) 1322 assert(false)
1321 } 1323 }
1322 } 1324 }
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | chrome/browser/policy/policy_path_parser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698