bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

time: Fix test failure on FreeBSD 12.2/sparc64


From: Bruno Haible
Subject: time: Fix test failure on FreeBSD 12.2/sparc64
Date: Thu, 11 Jan 2024 13:51:51 +0100

On FreeBSD 12.2/sparc64 I see this test failure:

$ ./test-time
../../gltests/test-time.c:46: assertion 'tt3 >= tv2.tv_sec' failed
Abort trap (core dumped)

This patch fixes it.


2024-01-11  Bruno Haible  <bruno@clisp.org>

        time: Fix test failure on FreeBSD 12.2/sparc64.
        * m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on
        FreeBSD/sparc.
        * doc/posix-functions/time.texi: Mention the bug on FreeBSD/sparc.

diff --git a/doc/posix-functions/time.texi b/doc/posix-functions/time.texi
index c744c63974..39a00d4370 100644
--- a/doc/posix-functions/time.texi
+++ b/doc/posix-functions/time.texi
@@ -12,7 +12,7 @@
 This function is not consistent with @code{gettimeofday} and 
@code{timespec_get}
 on some platforms:
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=30200
-glibc 2.31 or newer on Linux, AIX 7.2, native Windows.
+glibc 2.31 or newer on Linux, FreeBSD 12.2/sparc64, AIX 7.2, native Windows.
 Namely, in the first 1 to 2.5 milliseconds of every second (or, on AIX and
 Windows, in the first 5 milliseconds of every second), @code{time} returns
 a value that is one less than the @code{tv_sec} part of the return value of
diff --git a/m4/time.m4 b/m4/time.m4
index eafa66f50c..6f2347b2f1 100644
--- a/m4/time.m4
+++ b/m4/time.m4
@@ -1,4 +1,4 @@
-# time.m4 serial 4
+# time.m4 serial 5
 dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_TIME]
      dnl   - glibc >= 2.31 with Linux. And binaries produced on glibc < 2.31
      dnl     need to run fine on newer glibc versions as well; therefore ignore
      dnl     __GLIBC_MINOR__.
+     dnl   - FreeBSD/sparc,
      dnl   - AIX,
      dnl   - native Windows.
      case "$host_os" in
@@ -31,6 +32,12 @@ AC_DEFUN([gl_FUNC_TIME]
            [gl_cv_func_time_works="guessing no"],
            [gl_cv_func_time_works="guessing yes"])
          ;;
+       freebsd*)
+         case "$host_cpu" in
+           sparc*)        gl_cv_func_time_works="guessing no";;
+           *)             gl_cv_func_time_works="guessing yes";;
+         esac
+         ;;
        aix*)              gl_cv_func_time_works="guessing no";;
        mingw* | windows*) gl_cv_func_time_works="guessing no";;
        *)                 gl_cv_func_time_works="guessing yes";;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]