mirror of
https://github.com/facebook/rocksdb.git
synced 2026-10-29 08:48:20 +03:00
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/14296 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: anand1976 Differential Revision: D92013593 fbshipit-source-id: 0b4e00339bef3f76fc5b9ad35e2383c5e4f828f9