Paul Eggert wrote:
> For example, lib/parse-duration.h currently 
> doesn't have the <config.h> reminder, even though it uses time_t and 
> therefore is vulnerable to a bug if a program includes it without 
> including config.h (and defining _TIME_BITS) first.

Good point. parse-duration.h is not defining the time_t type; therefore
we don't need the reminder there. In POSIX:2008, the application can
get the time_t type defined by including one of the following files:
  <sched.h>
  <sys/msg.h>
  <sys/select.h>
  <sys/sem.h>
  <sys/shm.h>
  <sys/stat.h>
  <sys/time.h>
  <sys/types.h>
  <time.h>
  <utime.h>
Gnulib should therefore override each of these include files and
make sure <config.h> (with the possible _TIME_BITS definition) is
included first.

> Do we need to make 
> another pass through the .h files and comments to deal with time_t, 
> struct timespec, _TIME_BITS, etc.?

In my opinion, only the 10 modules mentioned above need to be
changed or created.

> And similarly for off_t?

off_t is defined by one of these files:
  <aio.h>
  <fcntl.h>
  <stdio.h>
  <sys/mman.h>
  <sys/stat.h>
  <sys/types.h>
  <unistd.h>
The same reasoning applies. But for off_t, IMO, the urgency is low, since
most packages have already been using AC_SYS_LARGEFILE for nearly 20 years.
Therefore there are not many application bugs that we can hope to uncover
in this area now.

Bruno




Reply via email to