diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-22 03:37:51 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-22 03:37:51 +0000 |
commit | e6844cb7a91188729a122d6696ff30f7b07cf428 (patch) | |
tree | 75b2033b04ce716a54a74985e4b3811df9e921d8 /skia/skia.gyp | |
parent | 57e67ac2893ee64d012ec8cc2342ba50ccd661db (diff) | |
download | chromium_src-e6844cb7a91188729a122d6696ff30f7b07cf428.zip chromium_src-e6844cb7a91188729a122d6696ff30f7b07cf428.tar.gz chromium_src-e6844cb7a91188729a122d6696ff30f7b07cf428.tar.bz2 |
enable -Wstring-conversion when compiling with clang
Summary of try run with flag enabled as warning:
On linux_clang, there's false positives from a bunch of assert usage that does !"string" or "string" for a true or false value. It's only in third_party (Mesa, skia, libjingle, etc.) so it probably wouldn't be too hard to disable the warnings in those subtrees.
It diagnoses 4 useful locations:
1.
../../base/debug/trace_event_unittest.cc:70:41: warning: implicit conversion turns string literal into bool: 'const char [2]' to 'bool' [-Wstring-conversion]
TraceLog::GetInstance()->SetEnabled("*");
~~~~~~~~ ^~~
2.
../../sync/syncable/entry_kernel.cc:77:38: warning: implicit conversion turns string literal into bool: 'const char [5]' to 'bool' [-Wstring-conversion]
value->SetBoolean("encrypted", "true");
~~~~~ ^~~~~~
3.
../../chrome/browser/webdata/web_data_service.cc:334:17: warning: implicit conversion turns string literal into bool: 'const char [44]' to 'bool' [-Wstring-conversion]
DLOG_ASSERT("WebDataService dtor called without Shutdown");
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/logging.h:595:43: note: expanded from macro 'DLOG_ASSERT'
4.
../../chrome/browser/renderer_host/web_cache_manager_unittest.cc:259:20: warning: implicit conversion turns string literal into bool: 'const char [29]' to 'bool' [-Wstring-conversion]
EXPECT_FALSE("Unexpected entry in strategy");
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finding #1 is what made me look into this, #3 and #4 are not doing what they're supposed to, and #2 is kind of funny so not all is lost.
So, 3 bugs and 1 very-close-to-a-bug: seems worth enabling.
R=thakis@chromium.org
TBR=darin@chromium.org, dhollowa@chromium.org, brettw@chromium.org, zea@chromium.org
BUG=177306
Review URL: https://chromiumcodereview.appspot.com/12258039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/skia.gyp')
-rw-r--r-- | skia/skia.gyp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/skia/skia.gyp b/skia/skia.gyp index be1a52f..5b32431 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -540,6 +540,18 @@ ], }, }], + # TODO(scottmg): http://crbug.com/177306 + ['clang==1', { + 'xcode_settings': { + 'WARNING_CFLAGS!': [ + # Don't warn about string->bool used in asserts. + '-Wstring-conversion', + ], + }, + 'cflags!': [ + '-Wstring-conversion', + ], + }], ], 'dependencies': [ 'skia_opts', |