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 /sync | |
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 'sync')
-rw-r--r-- | sync/syncable/entry_kernel.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc index b8ac824..5b21612 100644 --- a/sync/syncable/entry_kernel.cc +++ b/sync/syncable/entry_kernel.cc @@ -74,7 +74,7 @@ void SetEncryptableProtoValues( cryptographer->CanDecrypt(encrypted) && cryptographer->Decrypt(encrypted, &decrypted)) { value = EntitySpecificsToValue(decrypted); - value->SetBoolean("encrypted", "true"); + value->SetBoolean("encrypted", true); } else { value = EntitySpecificsToValue(kernel.ref(field)); } |