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

Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99



to, 2005-06-16 kello 12:10 +0200, Baurzhan Ismagulov kirjoitti:
> On Thu, Jun 16, 2005 at 12:47:13PM +0300, Lars Wirzenius wrote:
> > The -std=c99 option means that you want strict compliance to the 1999
> > version of the C standard. That standard does not define struct timespec
> > or nanosleep in <time.h> or anywhere else. Thus, there is no bug.
> 
> struct timespec and nanosleep are POSIX, and should be defined in time.h
> according to SUSv3 (see, e.g.,
> http://www.opengroup.org/onlinepubs/007908799/xsh/nanosleep.html). I
> don't see why strict C99 compliance should affect that header. I think
> it is a bug.

The C standard guarantees (see page 166, 7.1.3, "Reserved identifiers",
if you have a copy) that the standard headers do not define identifiers
that the C standard does not explicitly declare as defined by the
standard, reserved for future versions of the standard, or reserved to
the implementation. "struct timespec" and "nanosleep" are not such
identifiers.

Thus, it is clearly not a bug.

If you want to use nanosleep, do not compile with -std=c99. See the GNU
libc documentation, "1.2 Standards and Portability", for information on
how to choose and ask for support for the standards you need.




Reply to: