[libc-commits] [libc] [libc] implement clock_gettime using vDSO (PR #108458)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 13 06:55:05 PDT 2024


================
@@ -24,9 +24,10 @@ LIBC_INLINE constexpr bool expects_bool_condition(T value, T expected) {
 }
 } // namespace details
 } // namespace LIBC_NAMESPACE_DECL
-#define LIBC_LIKELY(x) LIBC_NAMESPACE::details::expects_bool_condition(x, true)
+#define LIBC_LIKELY(x)                                                         \
+  LIBC_NAMESPACE::details::expects_bool_condition(!!(x), true)
----------------
lntue wrote:

I think the intention for `x` instead of `!!(x)` is to enforce the explicit bool statement, instead of relying on the implicit bool cast, that can some time be surprising.  Can you update the usage in `clock_gettime.h` to explicit bool statement instead of changing these macros?

https://github.com/llvm/llvm-project/pull/108458


More information about the libc-commits mailing list