[PATCH] configure.ac: Fix gettimeofday check for C99 compilers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] configure.ac: Fix gettimeofday check for C99 compilers

Florian Weimer
* configure.ac (HAVE_GETTIMEOFDAY): Avoid reference to undeclared
exit function.
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f6919a7..5897ae5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,8 +127,8 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
                   int main ()
                   {
                     struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
-                    exit (gettimeofday (&t, 0) != 0
-                          || t.tv_sec < 0 || t.tv_usec < 0);
+                    return gettimeofday (&t, 0) != 0
+                          || t.tv_sec < 0 || t.tv_usec < 0;
                   }]])],
                   [ac_cv_func_gettimeofday=yes],
                   [ac_cv_func_gettimeofday=no],
--
2.21.0


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] configure.ac: Fix gettimeofday check for C99 compilers

Paul Smith-20
On Tue, 2019-09-10 at 13:33 +0200, Florian Weimer wrote:
> * configure.ac (HAVE_GETTIMEOFDAY): Avoid reference to undeclared
> exit function.

I applied this to Git.  Thanks for contributing to GNU make!


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make