[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
__attribute__ and timeval problems building findutils on IRIX
From: |
Rainer M. Canavan |
Subject: |
__attribute__ and timeval problems building findutils on IRIX |
Date: |
Wed, 2 Mar 2016 00:08:18 +0100 (CET) |
Hi,
I've stumbled over two small problems while trying to build findutils on IRIX
with the mipspro compilers. The first problem was that the compiler doesn't
support __attribute__, which is correctly detected by configure:
checking for __attribute__ ((__noreturn__)) support... no
which results in
#define HAVE_ATTRIBUTE_NORETURN 0
in config.h. There's a proper ifdef construct in find/defs.h to define it
to nothing if it's not supported, but the one in locate/code.c just
leaves it as ATTRIBUTE_NORETURN, causing a compile error. The patch below
would fix this:
diff -ur ./locate/code.c ../../findutils-4.6.0//locate/code.c
--- ./locate/code.c Mon Dec 28 22:10:23 CET 2015
+++ ./locate/code.c Tue Mar 01 22:49:41 CET 2016
@@ -83,7 +83,11 @@
#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+# if HAVE_ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+# else
+# define ATTRIBUTE_NORETURN /* nothing */
+# endif
#endif
A few tests cannot be compiled because struct timeval isn't
know. Shifting around the include statements or adding
time.h fixes these.
rainer
diff -ur ./tests/test-gettimeofday.c
../../findutils-4.6.0//tests/test-gettimeofday.c
--- ./tests/test-gettimeofday.c Tue Dec 22 18:32:53 CET 2015
+++ ../../findutils-4.6.0//tests/test-gettimeofday.c Tue Mar 01 22:56:07 CET
2016
@@ -17,6 +17,7 @@
#include <config.h>
+#include <time.h>
#include <sys/time.h>
#include "signature.h"
@@ -23,7 +24,6 @@
SIGNATURE_CHECK (gettimeofday, int,
(struct timeval *, GETTIMEOFDAY_TIMEZONE *));
-#include <time.h>
#include <stdio.h>
#include <string.h>
diff -ur ./tests/test-sys_time.c ../../findutils-4.6.0//tests/test-sys_time.c
--- ./tests/test-sys_time.c Tue Dec 22 18:32:53 CET 2015
+++ ../../findutils-4.6.0//tests/test-sys_time.c Tue Mar 01 22:57:56 CET
2016
@@ -18,6 +18,7 @@
#include <config.h>
+#include <time.h>
#include <sys/time.h>
/* Check that the 'struct timeval' type is defined. */
- __attribute__ and timeval problems building findutils on IRIX,
Rainer M. Canavan <=