[flang-commits] [flang] [flang] Fix build on Darwin after #92571 (PR #94327)
Leandro Lupori via flang-commits
flang-commits at lists.llvm.org
Tue Jun 4 01:58:03 PDT 2024
https://github.com/luporl created https://github.com/llvm/llvm-project/pull/94327
flang/runtime/time-intrinsic.cpp:403:19: error: comparison of
integers of different signs: 'clock_t' (aka 'unsigned long') and
'int' [-Werror,-Wsign-compare]
if (times(&tms) != -1) {
>From ed75b2a3fd552bd995eaf63e5260a719e59b1ef5 Mon Sep 17 00:00:00 2001
From: Leandro Lupori <leandro.lupori at linaro.org>
Date: Tue, 4 Jun 2024 10:51:43 +0200
Subject: [PATCH] [flang] Fix build on Darwin after #92571
flang/runtime/time-intrinsic.cpp:403:19: error: comparison of
integers of different signs: 'clock_t' (aka 'unsigned long') and
'int' [-Werror,-Wsign-compare]
if (times(&tms) != -1) {
---
flang/runtime/time-intrinsic.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/runtime/time-intrinsic.cpp b/flang/runtime/time-intrinsic.cpp
index 989d4f804c5f7..a141fe63764a7 100644
--- a/flang/runtime/time-intrinsic.cpp
+++ b/flang/runtime/time-intrinsic.cpp
@@ -400,7 +400,7 @@ void RTNAME(Etime)(const Descriptor *values, const Descriptor *time,
}
#else
struct tms tms;
- if (times(&tms) != -1) {
+ if (times(&tms) != (clock_t)-1) {
usrTime = ((double)(tms.tms_utime)) / sysconf(_SC_CLK_TCK);
sysTime = ((double)(tms.tms_stime)) / sysconf(_SC_CLK_TCK);
realTime = usrTime + sysTime;
More information about the flang-commits
mailing list