[libcxx-commits] [libcxx] [libc++] avoid a GCC -Wsigned-compare warning where time_t is unsigned (PR #76560)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 29 08:34:16 PST 2023


================
@@ -44,7 +44,7 @@ void condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
   seconds s = duration_cast<seconds>(d);
   typedef decltype(ts.tv_sec) ts_sec;
   constexpr ts_sec ts_sec_max = numeric_limits<ts_sec>::max();
-  if (s.count() < ts_sec_max) {
+  if ((unsigned long long)s.count() < ts_sec_max) {
----------------
mordante wrote:

I'm quite sure I had a comment in the Phab review which is down. Please use `cmp_less` which should be type safe without manual casts. This is a C++20 feature and the dylib requires C++20.

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


More information about the libcxx-commits mailing list