diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 19:28:06 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 19:28:06 +0000 |
commit | b91902d2d0822efddcc04d7feecbe26704e4f0d2 (patch) | |
tree | 5ea178b825f69ef64272d29507a14b7d8f2cf54e | |
parent | 8f113df07aaca851457ba19602f01087e520f4df (diff) | |
download | chromium_src-b91902d2d0822efddcc04d7feecbe26704e4f0d2.zip chromium_src-b91902d2d0822efddcc04d7feecbe26704e4f0d2.tar.gz chromium_src-b91902d2d0822efddcc04d7feecbe26704e4f0d2.tar.bz2 |
Unignore most warnings on POSIX in build/SConscript.main.
BUG=2053
Patch from Paweł Hajdan jr <phajdan.jr@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2272 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/compiler_specific.h | 8 | ||||
-rw-r--r-- | build/SConscript.main | 17 | ||||
-rw-r--r-- | net/base/test_completion_callback_unittest.cc | 5 | ||||
-rw-r--r-- | skia/SConscript | 5 | ||||
-rw-r--r-- | webkit/glue/event_conversion.h | 5 | ||||
-rw-r--r-- | webkit/glue/plugins/test/plugin_npobject_proxy_test.cc | 7 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 5 | ||||
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.h | 6 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.cc | 5 | ||||
-rw-r--r-- | webkit/glue/weburlrequest_impl.h | 7 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 5 | ||||
-rw-r--r-- | webkit/port/bindings/scripts/CodeGeneratorV8.pm | 31 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_binding.h | 7 | ||||
-rw-r--r-- | webkit/port/platform/TemporaryLinkStubs.cpp | 5 |
14 files changed, 68 insertions, 50 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index 0043dd8..4ab4c91 100644 --- a/base/compiler_specific.h +++ b/base/compiler_specific.h @@ -28,6 +28,13 @@ // The warning remains disabled until popped by MSVC_POP_WARNING. #define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ __pragma(warning(disable:n)) + +// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level +// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all +// warnings. +#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n)) + +// Pop effects of innermost MSVC_PUSH_* macro. #define MSVC_POP_WARNING() __pragma(warning(pop)) // Allows |this| to be passed as an argument in constructor initializer lists. @@ -47,6 +54,7 @@ #define MSVC_SUPPRESS_WARNING(n) #define MSVC_PUSH_DISABLE_WARNING(n) +#define MSVC_PUSH_WARNING_LEVEL(n) #define MSVC_POP_WARNING() #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code diff --git a/build/SConscript.main b/build/SConscript.main index 5dcda05..1aa9299 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -311,21 +311,10 @@ elif env['PLATFORM'] == 'posix': 'webkit', ] - # TODO: fix code that triggers these warnings. excluded_warnings = [ - '-Wno-unknown-pragmas', # TODO: remove all the Windows-specific #pragmas. - '-Wno-unused-function', # TODO: there's just one Skia function. - '-Wno-unused-variable', # TODO: there's just one v8 function. - '-Wno-switch', # TODO: this is likely masking real bugs. - '-Wno-sign-compare', # TODO: this is likely masking real bugs. - '-Wno-missing-braces', # TODO: just a file in net. - - # Not TODO: This is technically nonstandard, but a lot of the image - # decoding code depends on it and osx wants this. - '-Wno-multichar', - - '-Wno-deprecated', # Needed for using ext/hash_map on GCC 4.3 - '-Wno-reorder', # TODO: many tedious small fixes. + # TODO: Clean up uses of ext/hash_map and remove this. + # (see unordered_map and base/hash_tables.h) + '-Wno-deprecated' # Needed for using ext/hash_map on GCC 4.3 ] env.Replace( CCFLAGS = ['-m32', '-g', '-pthread'], diff --git a/net/base/test_completion_callback_unittest.cc b/net/base/test_completion_callback_unittest.cc index 23a2448..3f4dd5e 100644 --- a/net/base/test_completion_callback_unittest.cc +++ b/net/base/test_completion_callback_unittest.cc @@ -38,9 +38,8 @@ class ExampleEmployer::ExampleWorker : public base::RefCountedThreadSafe<ExampleWorker> { public: ExampleWorker(ExampleEmployer* employer, CompletionCallback* callback) - : callback_(callback), - employer_(employer), - origin_loop_(MessageLoop::current()) { + : employer_(employer), callback_(callback), + origin_loop_(MessageLoop::current()) { } void DoWork(); void DoCallback(); diff --git a/skia/SConscript b/skia/SConscript index a646836..74723d4 100644 --- a/skia/SConscript +++ b/skia/SConscript @@ -37,9 +37,8 @@ if env['PLATFORM'] == 'win32': ], ) elif env['PLATFORM'] in ('posix', 'darwin'): - if '-Wall' in env['CCFLAGS']: - # We're not responsible for bad warning hygiene in this third party code. - env['CCFLAGS'].remove('-Wall') + # Because images/SkStream.cpp has len asserts. + env['CXXFLAGS'].append('-Wno-unused-variable') input_files = [ 'animator/SkTime.cpp', diff --git a/webkit/glue/event_conversion.h b/webkit/glue/event_conversion.h index 8c75070..8f37267 100644 --- a/webkit/glue/event_conversion.h +++ b/webkit/glue/event_conversion.h @@ -6,12 +6,13 @@ #define WEBKIT_GLUE_EVENT_CONVERSION_H__ #include "base/basictypes.h" +#include "base/compiler_specific.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" #include "PlatformWheelEvent.h" -#pragma warning(pop) +MSVC_POP_WARNING(); namespace WebCore { class Widget; diff --git a/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc b/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc index c0ac83d..bc191be 100644 --- a/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc +++ b/webkit/glue/plugins/test/plugin_npobject_proxy_test.cc @@ -2,8 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/basictypes.h" +#include "base/compiler_specific.h" + +#if defined(OS_WIN) #define STRSAFE_NO_DEPRECATE #include <strsafe.h> +#endif #include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" namespace NPAPIClient { @@ -25,7 +30,7 @@ NPError NPObjectProxyTest::SetWindow(NPWindow* pNPWindow) { NPObject *doc = NPVARIANT_TO_OBJECT(docv); NPVariant strv; -#pragma warning(suppress: 4267) + MSVC_SUPPRESS_WARNING(4267); STRINGZ_TO_NPVARIANT("div", strv); NPVariant textv; diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 53cea39..a9d1fc4 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -29,6 +29,7 @@ #include <string> #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "base/gfx/platform_canvas.h" #include "base/scoped_ptr.h" #include "base/task.h" @@ -38,11 +39,11 @@ #include "webkit/glue/webplugin_delegate.h" #include "webkit/glue/webview_delegate.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "ResourceHandleClient.h" #include "Frame.h" #include "PlatformString.h" -#pragma warning(pop) +MSVC_POP_WARNING(); class AltErrorPageResourceFetcher; class WebErrorImpl; diff --git a/webkit/glue/webframeloaderclient_impl.h b/webkit/glue/webframeloaderclient_impl.h index bb0e35d..7612d88 100644 --- a/webkit/glue/webframeloaderclient_impl.h +++ b/webkit/glue/webframeloaderclient_impl.h @@ -5,9 +5,11 @@ #ifndef WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H__ #define WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H__ -#pragma warning(push, 0) +#include "base/compiler_specific.h" + +MSVC_PUSH_WARNING_LEVEL(0); #include "FrameLoaderClient.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #include "build/build_config.h" #include "googleurl/src/gurl.h" diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 1699f6f..d477645 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/compiler_specific.h" #include "build/build_config.h" #if defined(OS_WIN) @@ -11,7 +12,7 @@ #include "config.h" #include "webkit_version.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "BackForwardList.h" #include "Document.h" #include "FrameTree.h" @@ -27,7 +28,7 @@ #include "PlatformString.h" #include "RenderTreeAsText.h" #include "SharedBuffer.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #if USE(V8_BINDING) || USE(JAVASCRIPTCORE_BINDINGS) #include "JSBridge.h" // for set flags diff --git a/webkit/glue/weburlrequest_impl.h b/webkit/glue/weburlrequest_impl.h index 8628806..8b33385 100644 --- a/webkit/glue/weburlrequest_impl.h +++ b/webkit/glue/weburlrequest_impl.h @@ -5,13 +5,14 @@ #ifndef WEBKIT_GLUE_WEBURLREQUEST_IMPL_H__ #define WEBKIT_GLUE_WEBURLREQUEST_IMPL_H__ -#include "webkit/glue/weburlrequest.h" #include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "webkit/glue/weburlrequest.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "FrameLoadRequest.h" #include "HistoryItem.h" -#pragma warning(pop) +MSVC_POP_WARNING(); class WebRequestImpl : public WebRequest { public: diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 31be2ff..1fb2ebb 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -8,6 +8,7 @@ #include <set> #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "base/gfx/platform_canvas.h" #include "base/gfx/point.h" #include "base/gfx/size.h" @@ -16,10 +17,10 @@ #include "webkit/glue/webpreferences.h" #include "webkit/glue/webview.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "webkit/port/history/BackForwardList.h" #include "webkit/port/platform/WidgetClientWin.h" -#pragma warning(pop) +MSVC_POP_WARNING(); namespace WebCore { class Frame; diff --git a/webkit/port/bindings/scripts/CodeGeneratorV8.pm b/webkit/port/bindings/scripts/CodeGeneratorV8.pm index e617d6e..009b87e 100644 --- a/webkit/port/bindings/scripts/CodeGeneratorV8.pm +++ b/webkit/port/bindings/scripts/CodeGeneratorV8.pm @@ -425,6 +425,8 @@ sub GenerateNormalAttrGetter } } + my $getterStringUsesImp = $implClassName ne "double"; + # Getter push(@implContentDecls, <<END); static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { @@ -435,8 +437,12 @@ END push(@implContentDecls, <<END); V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::FastToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder()); $implClassName imp_instance = *imp_wrapper; +END + if ($getterStringUsesImp) { + push(@implContentDecls, <<END); $implClassName* imp = &imp_instance; END + } } elsif ($attrExt->{"v8OnProto"}) { # perform lookup first @@ -473,17 +479,20 @@ END my $returnType = $codeGenerator->StripModule($attribute->signature->type); - my $getterString = "imp->$getterFunc("; - $getterString .= "ec" if $useExceptions; - $getterString .= ")"; - if (IsRefPtrType($returnType)) { - $implIncludes{"wtf/GetPtr.h"} = 1; - $getterString = "WTF::getPtr(" . $getterString . ")"; - } - if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) { - $getterString .= ".toInt()"; - } - if ($implClassName eq "double") { + my $getterString; + if ($getterStringUsesImp) { + $getterString = "imp->$getterFunc("; + $getterString .= "ec" if $useExceptions; + $getterString .= ")"; + if (IsRefPtrType($returnType)) { + $implIncludes{"wtf/GetPtr.h"} = 1; + $getterString = "WTF::getPtr(" . $getterString . ")"; + } + if ($nativeType eq "int" and + $attribute->signature->extendedAttributes->{"ConvertFromString"}) { + $getterString .= ".toInt()"; + } + } else { $getterString = "imp_instance"; } diff --git a/webkit/port/bindings/v8/v8_binding.h b/webkit/port/bindings/v8/v8_binding.h index f5edfc4..81d7dde 100644 --- a/webkit/port/bindings/v8/v8_binding.h +++ b/webkit/port/bindings/v8/v8_binding.h @@ -5,6 +5,7 @@ #ifndef V8_BINDING_H__ #define V8_BINDING_H__ +#include "base/compiler_specific.h" #include "build/build_config.h" #include <v8.h> @@ -14,9 +15,9 @@ // Suppress warnings in CString of converting size_t to unsigned int. // TODO(fqian): fix CString.h. -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "CString.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #if defined(OS_LINUX) // Use the platform.h for linux. @@ -133,7 +134,7 @@ inline int ToInt32(v8::Handle<v8::Value> value) { // If a WebCore string length is greater than the threshold, // v8String creates an external string to avoid allocating // the string in the large object space (which has a high memory overhead). -static const int kV8ExternalStringThreshold = 2048; +static const unsigned int kV8ExternalStringThreshold = 2048; // Convert a string to a V8 string. inline v8::Handle<v8::String> v8String(const String& str) { diff --git a/webkit/port/platform/TemporaryLinkStubs.cpp b/webkit/port/platform/TemporaryLinkStubs.cpp index 341b043..34fb5f3 100644 --- a/webkit/port/platform/TemporaryLinkStubs.cpp +++ b/webkit/port/platform/TemporaryLinkStubs.cpp @@ -24,16 +24,17 @@ */ #include "config.h" +#include "base/compiler_specific.h" #define WIN32_COMPILE_HACK -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "Color.h" #include "SSLKeyGenerator.h" #include "KURL.h" #include "NotImplemented.h" #include "SharedBuffer.h" -#pragma warning(pop) +MSVC_POP_WARNING(); using namespace WebCore; |