-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Five return false; statements sit inside functions that return a pointer. Clang reports each one as -Wbool-conversion when the sources are compiled under C23, where false has type bool.
There is no functional change. Under C99, false is the macro 0, which is a null pointer constant, so these already return exactly NULL and no caller can tell the difference. The code is valid only because of that rule, and the same lines would be rejected by a C++ compiler.
Sites: four returns in the CHECK_BOUNDS macro in src/mc-range-mincover.c, expanded only inside the mc_getMincover* functions which return mc_mincover_t *; and the MONGOCRYPT_CTX_ERROR case in mongocrypt_ctx_mongo_db in src/mongocrypt-ctx.c, which returns const char *.
Reported while building the bundled sources in the MongoDB PHP driver, where the extension compiles them with clang defaults, currently C23.
- links to