bug-gnulib
[Top][All Lists]
Advanced

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

Re[2]: __attribute__ and timespec_t problems building findutils on IRIX


From: Rainer M. Canavan
Subject: Re[2]: __attribute__ and timespec_t problems building findutils on IRIX
Date: Wed, 2 Mar 2016 23:31:24 +0100 (CET)

Looks like I should double-check my bug reports. The problem wasn't
timeval, it was timespec_t. The error below occurs, whenever the
gnulib <sys/time.h> is included without including <time.h> beforehand, 
even when compiling a file containing just 

#include <config.h>
#include <sys/time.h>


cc-1020 c99: ERROR File = /usr/include/internal/signal_core.h, Line = 162
  The identifier "timespec_t" is undefined.

  extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t *);

The same restrictions don't exist with the system-supplied <sys/time.h>.
The relevant defines regarding timespec in config.h are:

PTHREAD_H_DEFINES_STRUCT_TIMESPEC = 0
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = 0
TIME_H_DEFINES_STRUCT_TIMESPEC = 1
UNISTD_H_DEFINES_STRUCT_TIMESPEC = 0

I've attached the output of the preprocessor from the above un-compilable
trivial program.



Paul Eggert <address@hidden> wrote:
> Eric Blake wrote:
> > Rather, we should be fixing gnulib's replacement <sys/time.h> header to
> > be self-contained.
> 
> How is HAVE_STRUCT_TIMEVAL defined in that build?

all the Makefiles have 

HAVE_STRUCT_TIMEVAL = 1

> If it's defined, why did the configure-time test for 'struct timeval' work 
> even 
> though test-gettimeofday.c does not work?

A casual glance at the tests performed by configure would indicate that
all tests include both sys/time.h and time.h before using timeval. 
test-gettimeofday.c on the other hand attempts to declare a timeval 
variable before including time.h:

test-gettimeofday.c also compiles and runs without any gnulib involvement
if I throw out the includes for config.h and signature.h as well as
the SIGNATURE_CHECK and don't specify any include paths.


rainer

Attachment: irix-gnulib-timespec-missing.out
Description: Text document


reply via email to

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