bug-glibc
[Top][All Lists]
Advanced

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

Re: sys/time.h: no more -ansi timercmp ?


From: David Morse
Subject: Re: sys/time.h: no more -ansi timercmp ?
Date: Sun, 24 Jun 2001 12:10:18 -0700
User-agent: Mutt/1.3.18i

Andreas Jaeger <address@hidden> wrote:
> Dave Morse <address@hidden> writes:
> 
> > If gcc is invoked with "-ansi" on a file that includes <sys/time.h>, it
> > doesn't pick up timercmp, but it does pick up gettimeofday.  
> > 
> > In glibc 2.0 (or whatever came on Red Hat 6.2), it did pick it up.
> > In glibc 2.1 (or whatever came on Woody), its gone.
> 
> Add the appropriate feature test macros (details are in the libc
> manual), e.g. _BSD_SOURCE.

Ok, read the entry in the manual.  Is the cpp symbol _BSD_SOURCE itself a
gnu extension, or part of some portable standard?  I.e. which of these is
correct:



#ifndef _BSD_SOURCE
 #define _BSD_SOURCE
 #include <sys/time.h>
 #undef _BSD_SOURCE
#else
 #include <sys/time.h>
#endif

or

#ifdef *GLIBC*
 #ifndef _BSD_SOURCE
  #define _BSD_SOURCE
  #include <sys/time.h>
  #undef _BSD_SOURCE
 #else
  #include <sys/time.h>
 #endif
#else
 #include <sys/time.h>
#endif

where *GLIBC* is some CPP symbol that I don't know yet, that that tells if
using glibc.

> > The man page for gettimeofday hasn't changed.
> Then tell it the man page maintainer (CC'ed).
> > Could the removal be a mistake?
> 
> No - it's a way to stricter standard conformance.
> 
> > If its intentional, how should I have figured that out by myself?  :)
> 
> Did you look at /usr/include/sys/time.h at all?





reply via email to

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