mirror of
https://github.com/facebook/rocksdb.git
synced 2026-07-07 14:47:40 +08:00
51feb25567
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/14312 This could is triggering `-Wstring-conversion`, which presents as: ``` warning: implicit conversion turns string literal into bool: A to B ``` This is often a bug and what was intended. The most frequent cause is the code was: ``` void foo(bool) { ... } void foo(std::string) { ... } foo("this gets interpreted as a bool"); ``` It is also possible the issue is innocuous as part of an assert: ``` assert(!"this string is true, so the assertion is false"); EXPECT_FALSE("this string is true, so the expect fails"); ``` in these cases the use is to "cute", so we modify the code to make it more obvious. ``` assert(false && "the compiler recognizes and doesn't complain about this pattern"); FAIL() << "much more obvious"; ``` Reviewed By: dmm-fb Differential Revision: D92528316 fbshipit-source-id: 93fbb624e8731c4cdb559746b44c1aa71d786304