Eric Blake wrote: > The whole point of the signature checks is that POSIX 2008 requires > headers to be self-contained.
Yes, right. > Therefore, I'm pushing this instead, which should fix pread, fseeko, > ftello, getdelim, and getline. The stdio.h part of your commit helps when one of these modules is in use. But POSIX says that <stdio.h> should define ssize_t unconditionally. Therefore we should be able to test it in test-stdio.c, like we do in test-unistd.c. When I do this, on a glibc system, I get errors: test-stdio.c:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘t2’ test-stdio.c:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘t4’ I'm applying this. - Whereas the unistd.in.h part of your commit was unnecessary, since it did not fix Ralf's problem with 'pread', and we did not receive reports that test-unistd.c failed to compile due to missing ssize_t. 2010-01-07 Bruno Haible <br...@clisp.org> stdio: Ensure <stdio.h> defines off_t, ssize_t, va_list. * lib/stdio.in.h: Include <sys/types.h> unconditionally. * tests/test-stdio.c: Verify that fpos_t, off_t, size_t, ssize_t, va_list are defined. * doc/posix-headers/stdio.texi: Document the bug of missing types. Reported by Eric Blake. --- doc/posix-headers/stdio.texi.orig Thu Jan 7 23:08:10 2010 +++ doc/posix-headers/stdio.texi Thu Jan 7 23:02:37 2010 @@ -8,6 +8,15 @@ Portability problems fixed by Gnulib: @itemize @item +The type @code{off_t} is missing on some platforms: +glibc 2.8 and others. +...@item +The type @code{ssize_t} is missing on some platforms: +glibc 2.8, MacOS X 10.5, Solaris 10, and others. +...@item +The type @code{va_list} is missing on some platforms: +glibc 2.8, OpenBSD 4.0, Solaris 10, and others. +...@item Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 --- lib/stdio.in.h.orig Thu Jan 7 23:08:10 2010 +++ lib/stdio.in.h Thu Jan 7 23:05:31 2010 @@ -36,14 +36,13 @@ #ifndef _GL_STDIO_H #define _GL_STDIO_H +/* Get va_list. Needed on many systems, including glibc 2.8. */ #include <stdarg.h> + #include <stddef.h> -#if (@GNULIB_FSEEKO@ || @GNULIB_FTELLO@ || @GNULIB_GETDELIM@ \ - || @GNULIB_GETLINE@ || defined GNULIB_POSIXCHECK) -/* Get off_t and ssize_t. */ -# include <sys/types.h> -#endif +/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8. */ +#include <sys/types.h> #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ --- tests/test-stdio.c.orig Thu Jan 7 23:08:10 2010 +++ tests/test-stdio.c Thu Jan 7 22:48:00 2010 @@ -1,5 +1,5 @@ /* Test of <stdio.h> substitute. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,13 @@ per POSIX 2008. */ verify (sizeof NULL == sizeof (void *)); +/* Check that the types are all defined. */ +fpos_t t1; +off_t t2; +size_t t3; +ssize_t t4; +va_list t5; + int main (void) {