Re: sys/time.h and time.h

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

 



On Sun, Feb 28, 2021 at 5:44 PM Thien-Thi Nguyen <ttn@xxxxxxxxxxx> wrote:
> My question is: To upgrade, which is preferred, (a) or (b)?
>
> (a)
>  #if HAVE_SYS_TIME_H
>  # include <sys/time.h>
>  #else
>  # include <time.h>
>  #endif
>
> (b)
>  #if HAVE_SYS_TIME_H
>  # include <sys/time.h>
>  #endif
>  #include <time.h>
>
> The difference is #include <time.h> is unconditional in (b),
> which is OK according to my reading of the warning message
> above.  (Thus, my guess is (b).)

Yes, (b) is what you should have, and a regular AC_CHECK_HEADERS for
sys/time.h. I'll happily take a patch to make this clearer in the
notes left by autoupdate and/or the manual.

zw




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux