Skip to content

[flang] Fix build on Darwin after #92571 #94327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

luporl
Copy link
Contributor

@luporl luporl commented Jun 4, 2024

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:403:19: error: comparison of
integers of different signs: 'clock_t' (aka 'unsigned long') and
'int' [-Werror,-Wsign-compare]
  if (times(&tms) != -1) {
@llvmbot llvmbot added flang:runtime flang Flang issues not falling into any other category labels Jun 4, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2024

@llvm/pr-subscribers-flang-runtime

Author: Leandro Lupori (luporl)

Changes

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) {


Full diff: https://github.com/llvm/llvm-project/pull/94327.diff

1 Files Affected:

  • (modified) flang/runtime/time-intrinsic.cpp (+1-1)
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;

@luporl luporl requested a review from JumpMasterJJ June 4, 2024 08:58
@JumpMasterJJ
Copy link
Member

LGTM. Thanks for your fixing.

@luporl
Copy link
Contributor Author

luporl commented Jun 5, 2024

Thanks for the review!
The Windows CI failure on Semantics/call40.f90 is a known (unrelated) issue that was fixed yesterday.

@luporl luporl merged commit 79b1137 into llvm:main Jun 5, 2024
8 of 10 checks passed
@luporl luporl deleted the luporl-fix-mac-build branch June 5, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:runtime flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants