[flang-commits] [flang] 79b1137 - [flang] Fix build on Darwin after #92571 (#94327)
via flang-commits
flang-commits at lists.llvm.org
Tue Jun 4 23:59:01 PDT 2024
Author: Leandro Lupori
Date: 2024-06-05T08:58:56+02:00
New Revision: 79b1137666da80184ee2459301194d518b40605a
URL: https://github.com/llvm/llvm-project/commit/79b1137666da80184ee2459301194d518b40605a
DIFF: https://github.com/llvm/llvm-project/commit/79b1137666da80184ee2459301194d518b40605a.diff
LOG: [flang] Fix build on Darwin after #92571 (#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) {
Added:
Modified:
flang/runtime/time-intrinsic.cpp
Removed:
################################################################################
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