Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
At Sun, 24 Jul 2005 11:13:25 +0200, Baurzhan Ismagulov wrote: On Sun, Jul 24, 2005 at 05:29:47PM +0900, GOTO Masanori wrote: Should Linux man page be updated to mention _POSIX_C_SOURCE? I also don't know it should be described to linux man pages - if you think so, please reassign it to manpages-dev. However linux manpages is not the only reference, I think. Sure, but it would be nice to have it at least there. BTW, defining _POSIX_SOURCE, which is described in the glibc documentation, didn't work for me. Is it a bug, or does POSIX.1 mean POSIX 1990 only? /usr/include/features.h describes the actual detail, please check it out. Thanks for the hint! At that time I had only grepped for the macros; now I saw the comments in the beginning of the files. Seems that nanosleep was not part of IEEE Std 1003.1; this answers my question. OK :) How do you think that this bug report should be reassigned to manpages-dev, or simple close? Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
tags 314435 fixed-upstream thanks Hello Martin, I think nanosleep requires #define _POSIX_C_SOURCE 199309L. Or do we need different pages for nanosleep(2) and nanosleep(3)? With kind regards, Baurzhan. This is correct. I have fixed this for the next man-pages release (2.08). Cheers, Michael -- Michael Kerrisk maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 Want to help with man page maintenance? Grab the latest tarball at ftp://ftp.win.tue.nl/pub/linux-local/manpages/ and grep the source files for 'FIXME'. GMX DSL = Maximale Leistung zum minimalen Preis! 2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Hello Masanori (this is your first name, isn't it?), On Mon, Jul 25, 2005 at 07:48:00PM +0900, GOTO Masanori wrote: How do you think that this bug report should be reassigned to manpages-dev, or simple close? I've already reassigned it to manpages-dev, and it is already fixed-upstream thanks to Michael. Thanks much! Baurzhan. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
At Mon, 25 Jul 2005 15:23:12 +0200, Baurzhan Ismagulov wrote: How do you think that this bug report should be reassigned to manpages-dev, or simple close? I've already reassigned it to manpages-dev, and it is already fixed-upstream thanks to Michael. Baurzhan and Michael, thanks for your quick reply and works :) Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
At Sat, 18 Jun 2005 11:44:00 +0200, Baurzhan Ismagulov wrote: However, I still have a problem. My intention is to use -std=c99 and define macros like _BSD_SOURCE in order to document all portability issues at the top of the files. After I defined _POSIX_C_SOURCE to 200201L, I'm able to compile the file without problems. However, neither SUSv3, nor Linux man page say anything about it. That is why I used to think that struct timespec and nanosleep MUST be available after a bare #include time.h. Does POSIX specify whether the availability can be controlled with a macro? Should Linux man page be updated to mention _POSIX_C_SOURCE? I also don't know it should be described to linux man pages - if you think so, please reassign it to manpages-dev. However linux manpages is not the only reference, I think. BTW, defining _POSIX_SOURCE, which is described in the glibc documentation, didn't work for me. Is it a bug, or does POSIX.1 mean POSIX 1990 only? /usr/include/features.h describes the actual detail, please check it out. Regards, -- gotom -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Hello Masanori, On Sun, Jul 24, 2005 at 05:29:47PM +0900, GOTO Masanori wrote: Should Linux man page be updated to mention _POSIX_C_SOURCE? I also don't know it should be described to linux man pages - if you think so, please reassign it to manpages-dev. However linux manpages is not the only reference, I think. Sure, but it would be nice to have it at least there. BTW, defining _POSIX_SOURCE, which is described in the glibc documentation, didn't work for me. Is it a bug, or does POSIX.1 mean POSIX 1990 only? /usr/include/features.h describes the actual detail, please check it out. Thanks for the hint! At that time I had only grepped for the macros; now I saw the comments in the beginning of the files. Seems that nanosleep was not part of IEEE Std 1003.1; this answers my question. With kind regards, Baurzhan. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Hello Martin, I think nanosleep requires #define _POSIX_C_SOURCE 199309L. Or do we need different pages for nanosleep(2) and nanosleep(3)? With kind regards, Baurzhan. diff -Naurp -X /home/ibr/tmp/root/prg/dontdiff.ibr manpages-2.02.orig/man2/nanosleep.2 manpages-2.02/man2/nanosleep.2 --- manpages-2.02.orig/man2/nanosleep.2 2004-11-03 14:51:07.0 +0100 +++ manpages-2.02/man2/nanosleep.2 2005-07-24 11:49:44.0 +0200 @@ -29,6 +29,7 @@ .SH NAME nanosleep \- pause execution for a specified time .SH SYNOPSIS +.B #define _POSIX_C_SOURCE 199309L .B #include time.h .sp \fBint nanosleep(const struct timespec *\fIreq\fB, struct timespec *\fIrem\fB);
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Hello Lars and Daniel, thanks much for the links and explanations! On Thu, Jun 16, 2005 at 01:37:34PM +0300, Lars Wirzenius wrote: 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. Indeed. I've overseen that time.h is also defined by C99. I've changed my opinion regarding whether this is a libc6-dev bug. However, I still have a problem. My intention is to use -std=c99 and define macros like _BSD_SOURCE in order to document all portability issues at the top of the files. After I defined _POSIX_C_SOURCE to 200201L, I'm able to compile the file without problems. However, neither SUSv3, nor Linux man page say anything about it. That is why I used to think that struct timespec and nanosleep MUST be available after a bare #include time.h. Does POSIX specify whether the availability can be controlled with a macro? Should Linux man page be updated to mention _POSIX_C_SOURCE? BTW, defining _POSIX_SOURCE, which is described in the glibc documentation, didn't work for me. Is it a bug, or does POSIX.1 mean POSIX 1990 only? With kind regards, Baurzhan. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Package: libc6-dev Version: 2.3.2.ds1-21 Severity: normal Hello, consider the following example: #include time.h int main(void) { struct timespec a; nanosleep(a, a); return 0; } Compilation with gcc -Wall -g -std=c99 produces the following errors: c.c: In Funktion main: c.c:5: error: storage size of `a' isn't known c.c:6: Warnung: implicit declaration of function `nanosleep' c.c:5: Warnung: unused variable `a' The same source is compiled finely without -std=c99. gcc -v output: Lese Spezifikationen von /usr/lib/gcc-lib/i486-linux/3.3.4/specs Konfiguriert mit: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread-Modell: posix gcc-Version 3.3.4 (Debian 1:3.3.4-7) Thanks in advance, Baurzhan. -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.10-1-686 Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Versions of packages libc6-dev depends on: ii libc62.3.2.ds1-21GNU C Library: Shared libraries an ii linux-kernel-headers 2.5.999-test7-bk-17 Linux Kernel Headers for developme -- no debconf information
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
to, 2005-06-16 kello 10:47 +0200, Baurzhan Ismagulov kirjoitti: #include time.h int main(void) { struct timespec a; nanosleep(a, a); return 0; } Compilation with gcc -Wall -g -std=c99 produces the following errors: c.c: In Funktion main: c.c:5: error: storage size of `a' isn't known c.c:6: Warnung: implicit declaration of function `nanosleep' c.c:5: Warnung: unused variable `a' The same source is compiled finely without -std=c99. 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.
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
Hello Lars, 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. With kind regards, Baurzhan. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
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. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#314435: libc6-dev: struct timespec and nanosleep() not available with -std=c99
On Thu, Jun 16, 2005 at 12:10:44PM +0200, Baurzhan Ismagulov wrote: 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. In addition to what Lars wrote, strict compliance affects time.h because time.h is specified in the ISO C99 standard: it provides time_t, struct tm, clock(), mktime(), et cetera. -- Daniel Jacobowitz CodeSourcery, LLC -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]