PATCH [3/n]: Add __snseconds_t and __SNSECONDS_T_TYPE

Paul Eggert eggert@cs.ucla.edu
Thu Mar 15 22:05:00 GMT 2012


On 03/15/2012 01:57 PM, H.J. Lu wrote:
> What is the real consequence of using long long on tv_nsec,
> except for not POSIX compliant? Will it lead to wrong code?

It would break applications that do anything like this:

  struct timespec t;
  long *p = &t->tv_nsec;

Such applications work fine now and conform to POSIX, but would
either not compile or (worse) might compile and do the
wrong thing, if tv_nsec were wider than 'long'.



More information about the Libc-alpha mailing list