bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdlib tweak


From: Eric Blake
Subject: Re: stdlib tweak
Date: Tue, 22 Dec 2009 19:14:10 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> > +static int (*check) (char const *, int, char const *) = symlinkat;
> > +
> > in order to validate that a function is correctly declared when the user
> > includes just the one header named in the standards.  We can then fix the
> > fallout by making the *.in.h headers pull in the necessary pre-requisites 
for
> > functions that declared in the wrong system header.  Any objections?
> 
> Good idea.
> 
> You might want to use a name less likely than "check"
> to impinge on the name space of the test program.

I went with signature_check.  Here's the patch:


From: Eric Blake <address@hidden>
Date: Tue, 22 Dec 2009 10:57:14 -0700
Subject: [PATCH] tests: add signature checks

These tests will help catch problems similar to the one recently
fixed for cygwin declaring getsubopt in the wrong header.

* tests/test-isfinite.c (isfinite): Ensure macro declaration.
* tests/test-isinf.c (isinf): Likewise.
* tests/test-isnan.c (isnan): Likewise.
* tests/test-signbit.c (signbit): Likewise.
* tests/test-atexit.c (signature_check): Ensure function is
declared with correct signature in correct header.
* tests/test-btowc.c (signature_check): Likewise.
* tests/test-canonicalize-lgpl.c (signature_check1)
(signature_check2): Likewise.
* tests/test-ceilf1.c (signature_check): Likewise.
* tests/test-ceill.c (signature_check): Likewise.
* tests/test-chown.c (signature_check): Likewise.
* tests/test-dprintf-posix.c (signature_check): Likewise.
* tests/test-dup2.c (signature_check): Likewise.
* tests/test-dup3.c (signature_check): Likewise.
* tests/test-duplocale.c (signature_check): Likewise.
* tests/test-fchdir.c (signature_check): Likewise.
* tests/test-fchownat.c (signature_check): Likewise.
* tests/test-fcntl.c (signature_check): Likewise.
* tests/test-fdopendir.c (signature_check): Likewise.
* tests/test-fflush.c (signature_check): Likewise.
* tests/test-flock.c (signature_check): Likewise.
* tests/test-floorf1.c (signature_check): Likewise.
* tests/test-floorl.c (signature_check): Likewise.
* tests/test-fnmatch.c (signature_check): Likewise.
* tests/test-fopen.c (signature_check): Likewise.
* tests/test-fprintf-posix.c (signature_check): Likewise.
* tests/test-freopen.c (signature_check): Likewise.
* tests/test-frexp.c (signature_check): Likewise.
* tests/test-frexpl.c (signature_check): Likewise.
* tests/test-fseek.c (signature_check): Likewise.
* tests/test-fseeko.c (signature_check): Likewise.
* tests/test-fstatat.c (signature_check): Likewise.
* tests/test-fsync.c (signature_check): Likewise.
* tests/test-ftell.c (signature_check): Likewise.
* tests/test-ftello.c (signature_check): Likewise.
* tests/test-futimens.c (signature_check): Likewise.
* tests/test-getaddrinfo.c (signature_check1, signature_check2)
(signature_check3): Likewise.
* tests/test-getcwd.c (signature_check): Likewise.
* tests/test-getdelim.c (signature_check): Likewise.
* tests/test-getdtablesize.c (signature_check): Likewise.
* tests/test-getgroups.c (signature_check): Likewise.
* tests/test-gethostname.c (signature_check): Likewise.
* tests/test-getline.c (signature_check): Likewise.
* tests/test-getopt.c (signature_check1, signature_check2)
(signature_check3): Likewise.
* tests/test-gettimeofday.c (signature_check): Likewise.
* tests/test-glob.c (signature_check1, signature_check2):
Likewise.
* tests/test-iconv.c (signature_check1, signature_check2)
(signature_check3): Likewise.
* tests/test-inet_ntop.c (signature_check): Likewise.
* tests/test-inet_pton.c (signature_check): Likewise.
* tests/test-isblank.c (signature_check): Likewise.
* tests/test-lchown.c (signature_check): Likewise.
* tests/test-ldexpl.c (signature_check): Likewise.
* tests/test-link.c (signature_check): Likewise.
* tests/test-linkat.c (signature_check): Likewise.
* tests/test-lseek.c (signature_check): Likewise.
* tests/test-lstat.c (signature_check): Likewise.
* tests/test-mbrtowc.c (signature_check): Likewise.
* tests/test-mbsinit.c (signature_check): Likewise.
* tests/test-mbsnrtowcs.c (signature_check): Likewise.
* tests/test-mbsrtowcs.c (signature_check): Likewise.
* tests/test-memchr.c (signature_check): Likewise.
* tests/test-memcmp.c (signature_check): Likewise.
* tests/test-memmem.c (signature_check): Likewise.
* tests/test-memrchr.c (signature_check): Likewise.
* tests/test-mkdir.c (signature_check): Likewise.
* tests/test-mkdirat.c (signature_check): Likewise.
* tests/test-mkfifo.c (signature_check): Likewise.
* tests/test-mkfifoat.c (signature_check1, signature_check2):
Likewise.
* tests/test-mknod.c (signature_check): Likewise.
* tests/test-nanosleep.c (signature_check): Likewise.
* tests/test-nl_langinfo.c (signature_check): Likewise.
* tests/test-obstack-printf.c (signature_check): Likewise.
* tests/test-open.c (signature_check): Likewise.
* tests/test-openat.c (signature_check): Likewise.
* tests/test-perror.c (signature_check): Likewise.
* tests/test-pipe2.c (signature_check): Likewise.
* tests/test-poll.c (signature_check): Likewise.
* tests/test-popen.c (signature_check1, signature_check2):
Likewise.
* tests/test-posix_spawn1.c (signature_check1, signature_check2)
(signature_check3, signature_check4, signature_check5)
(signature_check6, signature_check7, signature_check8)
(signature_check9, signature_check10): Likewise.
* tests/test-posix_spawn3.c (signature_check): Likewise.
* tests/test-pread.c (signature_check): Likewise.
* tests/test-printf-posix.c (signature_check): Likewise.
* tests/test-pty.c (signature_check1, signature_check2):
Likewise.
* tests/test-random_r.c (signature_check1, signature_check2)
(signature_check3, signature_check4): Likewise.
* tests/test-rawmemchr.c (signature_check): Likewise.
* tests/test-readlink.c (signature_check): Likewise.
* tests/test-remove.c (signature_check): Likewise.
* tests/test-rename.c (signature_check): Likewise.
* tests/test-renameat.c (signature_check): Likewise.
* tests/test-rmdir.c (signature_check): Likewise.
* tests/test-round1.c (signature_check): Likewise.
* tests/test-roundf1.c (signature_check): Likewise.
* tests/test-roundl.c (signature_check): Likewise.
* tests/test-select.c (signature_check): Likewise.
* tests/test-setenv.c (signature_check): Likewise.
* tests/test-sigaction.c (signature_check): Likewise.
* tests/test-sleep.c (signature_check): Likewise.
* tests/test-snprintf.c (signature_check): Likewise.
* tests/test-sprintf-posix.c (signature_check): Likewise.
* tests/test-stat.c (signature_check): Likewise.
* tests/test-stpncpy.c (signature_check): Likewise.
* tests/test-strcasestr.c (signature_check): Likewise.
* tests/test-strchrnul.c (signature_check): Likewise.
* tests/test-strerror.c (signature_check): Likewise.
* tests/test-strsignal.c (signature_check): Likewise.
* tests/test-strstr.c (signature_check): Likewise.
* tests/test-strtod.c (signature_check): Likewise.
* tests/test-strverscmp.c (signature_check): Likewise.
* tests/test-symlink.c (signature_check): Likewise.
* tests/test-symlinkat.c (signature_check1, signature_check2):
Likewise.
* tests/test-times.c (signature_check): Likewise.
* tests/test-trunc1.c (signature_check): Likewise.
* tests/test-truncf1.c (signature_check): Likewise.
* tests/test-truncl.c (signature_check): Likewise.
* tests/test-tsearch.c (signature_check1, signature_check2)
(signature_check3, signature_check4): Likewise.
* tests/test-uname.c (signature_check): Likewise.
* tests/test-unlink.c (signature_check): Likewise.
* tests/test-unlinkat.c (signature_check): Likewise.
* tests/test-unsetenv.c (signature_check): Likewise.
* tests/test-usleep.c (signature_check): Likewise.
* tests/test-utimensat.c (signature_check): Likewise.
* tests/test-vasprintf.c (signature_check1, signature_check2):
Likewise.
* tests/test-vdprintf-posix.c (signature_check): Likewise.
* tests/test-vfprintf-posix.c (signature_check): Likewise.
* tests/test-vprintf-posix.c (signature_check): Likewise.
* tests/test-vsnprintf.c (signature_check): Likewise.
* tests/test-vsprintf-posix.c (signature_check): Likewise.
* tests/test-wcrtomb.c (signature_check): Likewise.
* tests/test-wcsnrtombs.c (signature_check): Likewise.
* tests/test-wcsrtombs.c (signature_check): Likewise.
* tests/test-wcwidth.c (signature_check): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                      |  150 ++++++++++++++++++++++++++++++++++++++++
 tests/test-atexit.c            |    5 +-
 tests/test-btowc.c             |    4 +-
 tests/test-canonicalize-lgpl.c |    3 +
 tests/test-ceilf1.c            |    4 +-
 tests/test-ceill.c             |    2 +
 tests/test-chown.c             |    2 +
 tests/test-dprintf-posix.c     |    2 +
 tests/test-dup2.c              |    2 +
 tests/test-dup3.c              |    2 +
 tests/test-duplocale.c         |    2 +
 tests/test-fchdir.c            |    2 +
 tests/test-fchownat.c          |    2 +
 tests/test-fcntl.c             |    2 +
 tests/test-fdopendir.c         |    2 +
 tests/test-fflush.c            |    3 +
 tests/test-flock.c             |    8 ++-
 tests/test-floorf1.c           |    4 +-
 tests/test-floorl.c            |    2 +
 tests/test-fnmatch.c           |    2 +
 tests/test-fopen.c             |    2 +
 tests/test-fprintf-posix.c     |    4 +-
 tests/test-freopen.c           |    5 +-
 tests/test-frexp.c             |    4 +-
 tests/test-frexpl.c            |    2 +
 tests/test-fseek.c             |    3 +
 tests/test-fseeko.c            |    3 +
 tests/test-fstatat.c           |    2 +
 tests/test-fsync.c             |    5 +-
 tests/test-ftell.c             |    3 +
 tests/test-ftello.c            |    3 +
 tests/test-futimens.c          |    2 +
 tests/test-getaddrinfo.c       |    6 ++
 tests/test-getcwd.c            |    2 +
 tests/test-getdelim.c          |    3 +
 tests/test-getdtablesize.c     |    4 +-
 tests/test-getgroups.c         |    2 +
 tests/test-gethostname.c       |    3 +
 tests/test-getline.c           |    3 +
 tests/test-getopt.c            |   12 +++
 tests/test-gettimeofday.c      |    3 +
 tests/test-glob.c              |    4 +
 tests/test-iconv.c             |    8 ++-
 tests/test-inet_ntop.c         |    3 +
 tests/test-inet_pton.c         |    2 +
 tests/test-isblank.c           |    2 +
 tests/test-isfinite.c          |   10 ++-
 tests/test-isinf.c             |   10 ++-
 tests/test-isnan.c             |    5 ++
 tests/test-lchown.c            |    2 +
 tests/test-ldexpl.c            |    2 +
 tests/test-link.c              |    2 +
 tests/test-linkat.c            |    2 +
 tests/test-lseek.c             |    7 ++-
 tests/test-lstat.c             |    6 ++
 tests/test-mbrtowc.c           |    5 +-
 tests/test-mbsinit.c           |    4 +-
 tests/test-mbsnrtowcs.c        |    5 +-
 tests/test-mbsrtowcs.c         |    5 +-
 tests/test-memchr.c            |    2 +
 tests/test-memcmp.c            |    2 +
 tests/test-memmem.c            |    2 +
 tests/test-memrchr.c           |    2 +
 tests/test-mkdir.c             |    2 +
 tests/test-mkdirat.c           |    2 +
 tests/test-mkfifo.c            |    2 +
 tests/test-mkfifoat.c          |    3 +
 tests/test-mknod.c             |    2 +
 tests/test-nanosleep.c         |    2 +
 tests/test-nl_langinfo.c       |    2 +
 tests/test-obstack-printf.c    |    2 +
 tests/test-open.c              |    2 +
 tests/test-openat.c            |    2 +
 tests/test-perror.c            |    4 +-
 tests/test-pipe2.c             |    2 +
 tests/test-poll.c              |    5 +-
 tests/test-popen.c             |    3 +
 tests/test-posix_spawn1.c      |   21 ++++++
 tests/test-posix_spawn3.c      |    4 +
 tests/test-pread.c             |    2 +
 tests/test-printf-posix.c      |    4 +-
 tests/test-pty.c               |    5 ++
 tests/test-random_r.c          |   10 +++-
 tests/test-rawmemchr.c         |    2 +
 tests/test-readlink.c          |    2 +
 tests/test-remove.c            |    2 +
 tests/test-rename.c            |    5 +-
 tests/test-renameat.c          |    2 +
 tests/test-rmdir.c             |    2 +
 tests/test-round1.c            |    4 +-
 tests/test-roundf1.c           |    4 +-
 tests/test-roundl.c            |    2 +
 tests/test-select.c            |    5 ++
 tests/test-setenv.c            |    2 +
 tests/test-sigaction.c         |    3 +
 tests/test-signbit.c           |    5 ++
 tests/test-sleep.c             |    2 +
 tests/test-snprintf.c          |    4 +-
 tests/test-sprintf-posix.c     |    4 +-
 tests/test-stat.c              |    6 ++
 tests/test-stpncpy.c           |    5 +-
 tests/test-strcasestr.c        |    4 +-
 tests/test-strchrnul.c         |    2 +
 tests/test-strerror.c          |    5 +-
 tests/test-strsignal.c         |    5 +-
 tests/test-strstr.c            |    2 +
 tests/test-strtod.c            |    2 +
 tests/test-strverscmp.c        |    2 +
 tests/test-symlink.c           |    2 +
 tests/test-symlinkat.c         |    3 +
 tests/test-times.c             |    5 +-
 tests/test-trunc1.c            |    4 +-
 tests/test-truncf1.c           |    4 +-
 tests/test-truncl.c            |    2 +
 tests/test-tsearch.c           |   11 +++-
 tests/test-uname.c             |    2 +
 tests/test-unlink.c            |    2 +
 tests/test-unlinkat.c          |    2 +
 tests/test-unsetenv.c          |    2 +
 tests/test-usleep.c            |    2 +
 tests/test-utimensat.c         |    3 +
 tests/test-vasprintf.c         |    5 +-
 tests/test-vdprintf-posix.c    |    2 +
 tests/test-vfprintf-posix.c    |    4 +-
 tests/test-vprintf-posix.c     |    4 +-
 tests/test-vsnprintf.c         |    4 +-
 tests/test-vsprintf-posix.c    |    4 +-
 tests/test-wcrtomb.c           |    4 +-
 tests/test-wcsnrtombs.c        |    5 +-
 tests/test-wcsrtombs.c         |    5 +-
 tests/test-wcwidth.c           |    4 +-
 131 files changed, 572 insertions(+), 50 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5bd1e2d..83eceeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,155 @@
 2009-12-22  Eric Blake  <address@hidden>

+       tests: add signature checks
+       * tests/test-isfinite.c (isfinite): Ensure macro declaration.
+       * tests/test-isinf.c (isinf): Likewise.
+       * tests/test-isnan.c (isnan): Likewise.
+       * tests/test-signbit.c (signbit): Likewise.
+       * tests/test-atexit.c (signature_check): Ensure function is
+       declared with correct signature in correct header.
+       * tests/test-btowc.c (signature_check): Likewise.
+       * tests/test-canonicalize-lgpl.c (signature_check1)
+       (signature_check2): Likewise.
+       * tests/test-ceilf1.c (signature_check): Likewise.
+       * tests/test-ceill.c (signature_check): Likewise.
+       * tests/test-chown.c (signature_check): Likewise.
+       * tests/test-dprintf-posix.c (signature_check): Likewise.
+       * tests/test-dup2.c (signature_check): Likewise.
+       * tests/test-dup3.c (signature_check): Likewise.
+       * tests/test-duplocale.c (signature_check): Likewise.
+       * tests/test-fchdir.c (signature_check): Likewise.
+       * tests/test-fchownat.c (signature_check): Likewise.
+       * tests/test-fcntl.c (signature_check): Likewise.
+       * tests/test-fdopendir.c (signature_check): Likewise.
+       * tests/test-fflush.c (signature_check): Likewise.
+       * tests/test-flock.c (signature_check): Likewise.
+       * tests/test-floorf1.c (signature_check): Likewise.
+       * tests/test-floorl.c (signature_check): Likewise.
+       * tests/test-fnmatch.c (signature_check): Likewise.
+       * tests/test-fopen.c (signature_check): Likewise.
+       * tests/test-fprintf-posix.c (signature_check): Likewise.
+       * tests/test-freopen.c (signature_check): Likewise.
+       * tests/test-frexp.c (signature_check): Likewise.
+       * tests/test-frexpl.c (signature_check): Likewise.
+       * tests/test-fseek.c (signature_check): Likewise.
+       * tests/test-fseeko.c (signature_check): Likewise.
+       * tests/test-fstatat.c (signature_check): Likewise.
+       * tests/test-fsync.c (signature_check): Likewise.
+       * tests/test-ftell.c (signature_check): Likewise.
+       * tests/test-ftello.c (signature_check): Likewise.
+       * tests/test-futimens.c (signature_check): Likewise.
+       * tests/test-getaddrinfo.c (signature_check1, signature_check2)
+       (signature_check3): Likewise.
+       * tests/test-getcwd.c (signature_check): Likewise.
+       * tests/test-getdelim.c (signature_check): Likewise.
+       * tests/test-getdtablesize.c (signature_check): Likewise.
+       * tests/test-getgroups.c (signature_check): Likewise.
+       * tests/test-gethostname.c (signature_check): Likewise.
+       * tests/test-getline.c (signature_check): Likewise.
+       * tests/test-getopt.c (signature_check1, signature_check2)
+       (signature_check3): Likewise.
+       * tests/test-gettimeofday.c (signature_check): Likewise.
+       * tests/test-glob.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-iconv.c (signature_check1, signature_check2)
+       (signature_check3): Likewise.
+       * tests/test-inet_ntop.c (signature_check): Likewise.
+       * tests/test-inet_pton.c (signature_check): Likewise.
+       * tests/test-isblank.c (signature_check): Likewise.
+       * tests/test-lchown.c (signature_check): Likewise.
+       * tests/test-ldexpl.c (signature_check): Likewise.
+       * tests/test-link.c (signature_check): Likewise.
+       * tests/test-linkat.c (signature_check): Likewise.
+       * tests/test-lseek.c (signature_check): Likewise.
+       * tests/test-lstat.c (signature_check): Likewise.
+       * tests/test-mbrtowc.c (signature_check): Likewise.
+       * tests/test-mbsinit.c (signature_check): Likewise.
+       * tests/test-mbsnrtowcs.c (signature_check): Likewise.
+       * tests/test-mbsrtowcs.c (signature_check): Likewise.
+       * tests/test-memchr.c (signature_check): Likewise.
+       * tests/test-memcmp.c (signature_check): Likewise.
+       * tests/test-memmem.c (signature_check): Likewise.
+       * tests/test-memrchr.c (signature_check): Likewise.
+       * tests/test-mkdir.c (signature_check): Likewise.
+       * tests/test-mkdirat.c (signature_check): Likewise.
+       * tests/test-mkfifo.c (signature_check): Likewise.
+       * tests/test-mkfifoat.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-mknod.c (signature_check): Likewise.
+       * tests/test-nanosleep.c (signature_check): Likewise.
+       * tests/test-nl_langinfo.c (signature_check): Likewise.
+       * tests/test-obstack-printf.c (signature_check): Likewise.
+       * tests/test-open.c (signature_check): Likewise.
+       * tests/test-openat.c (signature_check): Likewise.
+       * tests/test-perror.c (signature_check): Likewise.
+       * tests/test-pipe2.c (signature_check): Likewise.
+       * tests/test-poll.c (signature_check): Likewise.
+       * tests/test-popen.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-posix_spawn1.c (signature_check1, signature_check2)
+       (signature_check3, signature_check4, signature_check5)
+       (signature_check6, signature_check7, signature_check8)
+       (signature_check9, signature_check10): Likewise.
+       * tests/test-posix_spawn3.c (signature_check): Likewise.
+       * tests/test-pread.c (signature_check): Likewise.
+       * tests/test-printf-posix.c (signature_check): Likewise.
+       * tests/test-pty.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-random_r.c (signature_check1, signature_check2)
+       (signature_check3, signature_check4): Likewise.
+       * tests/test-rawmemchr.c (signature_check): Likewise.
+       * tests/test-readlink.c (signature_check): Likewise.
+       * tests/test-remove.c (signature_check): Likewise.
+       * tests/test-rename.c (signature_check): Likewise.
+       * tests/test-renameat.c (signature_check): Likewise.
+       * tests/test-rmdir.c (signature_check): Likewise.
+       * tests/test-round1.c (signature_check): Likewise.
+       * tests/test-roundf1.c (signature_check): Likewise.
+       * tests/test-roundl.c (signature_check): Likewise.
+       * tests/test-select.c (signature_check): Likewise.
+       * tests/test-setenv.c (signature_check): Likewise.
+       * tests/test-sigaction.c (signature_check): Likewise.
+       * tests/test-sleep.c (signature_check): Likewise.
+       * tests/test-snprintf.c (signature_check): Likewise.
+       * tests/test-sprintf-posix.c (signature_check): Likewise.
+       * tests/test-stat.c (signature_check): Likewise.
+       * tests/test-stpncpy.c (signature_check): Likewise.
+       * tests/test-strcasestr.c (signature_check): Likewise.
+       * tests/test-strchrnul.c (signature_check): Likewise.
+       * tests/test-strerror.c (signature_check): Likewise.
+       * tests/test-strsignal.c (signature_check): Likewise.
+       * tests/test-strstr.c (signature_check): Likewise.
+       * tests/test-strtod.c (signature_check): Likewise.
+       * tests/test-strverscmp.c (signature_check): Likewise.
+       * tests/test-symlink.c (signature_check): Likewise.
+       * tests/test-symlinkat.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-times.c (signature_check): Likewise.
+       * tests/test-trunc1.c (signature_check): Likewise.
+       * tests/test-truncf1.c (signature_check): Likewise.
+       * tests/test-truncl.c (signature_check): Likewise.
+       * tests/test-tsearch.c (signature_check1, signature_check2)
+       (signature_check3, signature_check4): Likewise.
+       * tests/test-uname.c (signature_check): Likewise.
+       * tests/test-unlink.c (signature_check): Likewise.
+       * tests/test-unlinkat.c (signature_check): Likewise.
+       * tests/test-unsetenv.c (signature_check): Likewise.
+       * tests/test-usleep.c (signature_check): Likewise.
+       * tests/test-utimensat.c (signature_check): Likewise.
+       * tests/test-vasprintf.c (signature_check1, signature_check2):
+       Likewise.
+       * tests/test-vdprintf-posix.c (signature_check): Likewise.
+       * tests/test-vfprintf-posix.c (signature_check): Likewise.
+       * tests/test-vprintf-posix.c (signature_check): Likewise.
+       * tests/test-vsnprintf.c (signature_check): Likewise.
+       * tests/test-vsprintf-posix.c (signature_check): Likewise.
+       * tests/test-wcrtomb.c (signature_check): Likewise.
+       * tests/test-wcsnrtombs.c (signature_check): Likewise.
+       * tests/test-wcsrtombs.c (signature_check): Likewise.
+       * tests/test-wcwidth.c (signature_check): Likewise.
+
+2009-12-22  Eric Blake  <address@hidden>
+
        btowc: avoid infinite loop
        * m4/btowc.m4 (gl_FUNC_BTOWC): Add a timeout.
        * doc/posix-functions/btowc.texi (btowc): Document the problem.
diff --git a/tests/test-atexit.c b/tests/test-atexit.c
index 97afff5..d102ff5 100644
--- a/tests/test-atexit.c
+++ b/tests/test-atexit.c
@@ -1,5 +1,5 @@
 /* Test of execution of program termination handlers.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009 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
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdlib.h>
+
+int (*signature_check) (void (*) (void)) = atexit;
+
 #include <unistd.h>

 #define TEMPFILE "t-atexit.tmp"
diff --git a/tests/test-btowc.c b/tests/test-btowc.c
index b447d05..36eb852 100644
--- a/tests/test-btowc.c
+++ b/tests/test-btowc.c
@@ -1,5 +1,5 @@
 /* Test of conversion of unibyte character to wide character.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,8 @@

 #include <wchar.h>

+wint_t (*signature_check) (int) = btowc;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index 7667983..bcfa696 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -20,6 +20,9 @@

 #include <stdlib.h>

+char *(*signature_check1) (const char *, char *) = realpath;
+char *(*signature_check2) (const char *) = canonicalize_file_name;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/tests/test-ceilf1.c b/tests/test-ceilf1.c
index 3241936..9190025 100644
--- a/tests/test-ceilf1.c
+++ b/tests/test-ceilf1.c
@@ -1,5 +1,5 @@
 /* Test of rounding towards positive infinity.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <math.h>

+float (*signature_check) (float) = ceilf;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-ceill.c b/tests/test-ceill.c
index 764d2be..325c0e3 100644
--- a/tests/test-ceill.c
+++ b/tests/test-ceill.c
@@ -20,6 +20,8 @@

 #include <math.h>

+long double (*signature_check) (long double) = ceill;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-chown.c b/tests/test-chown.c
index 4265970..0a05ebf 100644
--- a/tests/test-chown.c
+++ b/tests/test-chown.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *, uid_t, gid_t) = chown;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-dprintf-posix.c b/tests/test-dprintf-posix.c
index 384d1ef..5d74517 100644
--- a/tests/test-dprintf-posix.c
+++ b/tests/test-dprintf-posix.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (int, const char *, ...) = dprintf;
+
 #include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
diff --git a/tests/test-dup2.c b/tests/test-dup2.c
index b22d1e6..b4a5405 100644
--- a/tests/test-dup2.c
+++ b/tests/test-dup2.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int, int) = dup2;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/tests/test-dup3.c b/tests/test-dup3.c
index 41fc16d..3a90d43 100644
--- a/tests/test-dup3.c
+++ b/tests/test-dup3.c
@@ -21,6 +21,8 @@

 #include <unistd.h>

+int (*signature_check) (int, int, int) = dup3;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
diff --git a/tests/test-duplocale.c b/tests/test-duplocale.c
index 354e13e..bba712f 100644
--- a/tests/test-duplocale.c
+++ b/tests/test-duplocale.c
@@ -22,6 +22,8 @@

 #if HAVE_DUPLOCALE

+locale_t (*signature_check) (locale_t) = duplocale;
+
 #include <langinfo.h>
 #include <monetary.h>
 #include <stdio.h>
diff --git a/tests/test-fchdir.c b/tests/test-fchdir.c
index 75819eb..4243ef9 100644
--- a/tests/test-fchdir.c
+++ b/tests/test-fchdir.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int) = fchdir;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/tests/test-fchownat.c b/tests/test-fchownat.c
index 2dbc857..cb33413 100644
--- a/tests/test-fchownat.c
+++ b/tests/test-fchownat.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int, char const *, uid_t, gid_t, int) = fchownat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-fcntl.c b/tests/test-fcntl.c
index 8ea1301..959f8d3 100644
--- a/tests/test-fcntl.c
+++ b/tests/test-fcntl.c
@@ -21,6 +21,8 @@
 /* Specification.  */
 #include <fcntl.h>

+int (*signature_check) (int, int, ...) = fcntl;
+
 /* Helpers.  */
 #include <errno.h>
 #include <stdarg.h>
diff --git a/tests/test-fdopendir.c b/tests/test-fdopendir.c
index 7e0b3ee..7c4c344 100644
--- a/tests/test-fdopendir.c
+++ b/tests/test-fdopendir.c
@@ -20,6 +20,8 @@

 #include <dirent.h>

+DIR *(*signature_check) (int) = fdopendir;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/tests/test-fflush.c b/tests/test-fflush.c
index 8e33c9f..3547445 100644
--- a/tests/test-fflush.c
+++ b/tests/test-fflush.c
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdio.h>
+
+int (*signature_check) (FILE *) = fflush;
+
 #include <unistd.h>

 int
diff --git a/tests/test-flock.c b/tests/test-flock.c
index e0147e8..3ec9afe 100644
--- a/tests/test-flock.c
+++ b/tests/test-flock.c
@@ -1,5 +1,5 @@
 /* Test of flock() function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -16,14 +16,16 @@

 #include <config.h>

+#include <sys/file.h>
+
+int (*signature_check) (int, int) = flock;
+
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>

-#include <sys/file.h>
-
 #define ASSERT(expr) \
   do                                                                    \
     {                                                                   \
diff --git a/tests/test-floorf1.c b/tests/test-floorf1.c
index 373724a..0c8be61 100644
--- a/tests/test-floorf1.c
+++ b/tests/test-floorf1.c
@@ -1,5 +1,5 @@
 /* Test of rounding towards negative infinity.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <math.h>

+float (*signature_check) (float) = floorf;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-floorl.c b/tests/test-floorl.c
index 7afea04..416da55 100644
--- a/tests/test-floorl.c
+++ b/tests/test-floorl.c
@@ -20,6 +20,8 @@

 #include <math.h>

+long double (*signature_check) (long double) = floorl;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-fnmatch.c b/tests/test-fnmatch.c
index 3e21d9d..811d2a5 100644
--- a/tests/test-fnmatch.c
+++ b/tests/test-fnmatch.c
@@ -20,6 +20,8 @@

 #include <fnmatch.h>

+int (*signature_check) (char const *, char const *, int) = fnmatch;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-fopen.c b/tests/test-fopen.c
index 29d7839..5971309 100644
--- a/tests/test-fopen.c
+++ b/tests/test-fopen.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+FILE *(*signature_check) (char const *, char const *) = fopen;
+
 #define BASE "test-fopen.t"

 #include "test-fopen.h"
diff --git a/tests/test-fprintf-posix.c b/tests/test-fprintf-posix.c
index 4133e40..75becdc 100644
--- a/tests/test-fprintf-posix.c
+++ b/tests/test-fprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible fprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (FILE *, char const *, ...) = fprintf;
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/test-freopen.c b/tests/test-freopen.c
index 23f2af5..551d7a5 100644
--- a/tests/test-freopen.c
+++ b/tests/test-freopen.c
@@ -1,5 +1,5 @@
 /* Test of opening a file stream.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdio.h>
+
+FILE *(*signature_check) (char const *, char const *, FILE *) = freopen;
+
 #include <stdlib.h>

 #define ASSERT(expr) \
diff --git a/tests/test-frexp.c b/tests/test-frexp.c
index 47ddab2..8d84b20 100644
--- a/tests/test-frexp.c
+++ b/tests/test-frexp.c
@@ -1,5 +1,5 @@
 /* Test of splitting a double into fraction and mantissa.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <math.h>

+double (*signature_check) (double, int *) = frexp;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-frexpl.c b/tests/test-frexpl.c
index e4367f6..aaec8d9 100644
--- a/tests/test-frexpl.c
+++ b/tests/test-frexpl.c
@@ -20,6 +20,8 @@

 #include <math.h>

+long double (*signature_check) (long double, int *) = frexpl;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-fseek.c b/tests/test-fseek.c
index 04fc966..2709a02 100644
--- a/tests/test-fseek.c
+++ b/tests/test-fseek.c
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdio.h>
+
+int (*signature_check) (FILE *, long, int) = fseek;
+
 #include <stdlib.h>

 #define ASSERT(expr) \
diff --git a/tests/test-fseeko.c b/tests/test-fseeko.c
index 4006e1e..255af1c 100644
--- a/tests/test-fseeko.c
+++ b/tests/test-fseeko.c
@@ -26,6 +26,9 @@
 #endif

 #include <stdio.h>
+
+int (*signature_check) (FILE *, off_t, int) = fseeko;
+
 #include <stdlib.h>

 #define ASSERT(expr) \
diff --git a/tests/test-fstatat.c b/tests/test-fstatat.c
index e965997..1b191b0 100644
--- a/tests/test-fstatat.c
+++ b/tests/test-fstatat.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (int, char const *, struct stat *, int) = fstatat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-fsync.c b/tests/test-fsync.c
index c00d54f..03f2853 100644
--- a/tests/test-fsync.c
+++ b/tests/test-fsync.c
@@ -16,10 +16,13 @@

 #include <config.h>

+#include <unistd.h>
+
+int (*signature_check) (int) = fsync;
+
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include <unistd.h>

 #define ASSERT(expr) \
   do                                                                         \
diff --git a/tests/test-ftell.c b/tests/test-ftell.c
index 0662865..f4d1744 100644
--- a/tests/test-ftell.c
+++ b/tests/test-ftell.c
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdio.h>
+
+long (*signature_check) (FILE *) = ftell;
+
 #include <stdlib.h>

 #include "binary-io.h"
diff --git a/tests/test-ftello.c b/tests/test-ftello.c
index f3183c8..4a8bee3 100644
--- a/tests/test-ftello.c
+++ b/tests/test-ftello.c
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <stdio.h>
+
+off_t (*signature_check) (FILE *) = ftello;
+
 #include <stdlib.h>

 #include "binary-io.h"
diff --git a/tests/test-futimens.c b/tests/test-futimens.c
index 4e049bd..dd900ea 100644
--- a/tests/test-futimens.c
+++ b/tests/test-futimens.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (int, struct timespec const[2]) = futimens;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index 7464ec2..f849ed7 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -18,8 +18,14 @@
 /* Written by Simon Josefsson.  */

 #include <config.h>
+
 #include <netdb.h>

+int (*signature_check1) (char const *, char const *, struct addrinfo const *,
+                         struct addrinfo **) = getaddrinfo;
+void (*signature_check2) (struct addrinfo *) = freeaddrinfo;
+char const *(*signature_check3) (int) = gai_strerror;
+
 #include <arpa/inet.h>
 #include <errno.h>
 #include <netinet/in.h>
diff --git a/tests/test-getcwd.c b/tests/test-getcwd.c
index debace7..49ea0a9 100644
--- a/tests/test-getcwd.c
+++ b/tests/test-getcwd.c
@@ -18,6 +18,8 @@

 #include <unistd.h>

+char *(*signature_check) (char *, size_t) = getcwd;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-getdelim.c b/tests/test-getdelim.c
index 8de43db..f2401df 100644
--- a/tests/test-getdelim.c
+++ b/tests/test-getdelim.c
@@ -20,6 +20,9 @@
 #include <config.h>

 #include <stdio.h>
+
+ssize_t (*signature_check) (char **, size_t *, int, FILE *) = getdelim;
+
 #include <stdlib.h>
 #include <string.h>

diff --git a/tests/test-getdtablesize.c b/tests/test-getdtablesize.c
index 577d329..68f6b15 100644
--- a/tests/test-getdtablesize.c
+++ b/tests/test-getdtablesize.c
@@ -1,5 +1,5 @@
 /* Test of getdtablesize() function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (void) = getdtablesize;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-getgroups.c b/tests/test-getgroups.c
index aed80f1..53a805e 100644
--- a/tests/test-getgroups.c
+++ b/tests/test-getgroups.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int, gid_t[]) = getgroups;
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-gethostname.c b/tests/test-gethostname.c
index 32723da..e85b812 100644
--- a/tests/test-gethostname.c
+++ b/tests/test-gethostname.c
@@ -19,6 +19,9 @@

 /* Get gethostname() declaration.  */
 #include <unistd.h>
+
+int (*signature_check) (char *, size_t) = gethostname;
+
 /* Get HOST_NAME_MAX definition.  */
 #include <limits.h>

diff --git a/tests/test-getline.c b/tests/test-getline.c
index cc40c55..765bea8 100644
--- a/tests/test-getline.c
+++ b/tests/test-getline.c
@@ -20,6 +20,9 @@
 #include <config.h>

 #include <stdio.h>
+
+ssize_t (*signature_check) (char **, size_t *, FILE *) = getline;
+
 #include <stdlib.h>
 #include <string.h>

diff --git a/tests/test-getopt.c b/tests/test-getopt.c
index 6811a02..f8740fd 100644
--- a/tests/test-getopt.c
+++ b/tests/test-getopt.c
@@ -27,9 +27,21 @@

 #if GNULIB_GETOPT_GNU
 # include <getopt.h>
+
+# ifndef __getopt_argv_const
+#  define __getopt_argv_const const
+# endif
+int (*signature_check1) (int, char *__getopt_argv_const *, char const *,
+                         struct option const *, int *) = getopt_long;
+int (*signature_check2) (int, char *__getopt_argv_const *, char const *,
+                         struct option const *, int *) = getopt_long_only;
+
 #endif
+
 #include <unistd.h>

+int (*signature_check3) (int, char * const[], char const *) = getopt;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-gettimeofday.c b/tests/test-gettimeofday.c
index 3b85879..360a23a 100644
--- a/tests/test-gettimeofday.c
+++ b/tests/test-gettimeofday.c
@@ -18,6 +18,9 @@
 #include <config.h>

 #include <sys/time.h>
+
+int (*signature_check) (struct timeval *, void *) = gettimeofday;
+
 #include <time.h>

 #include <stdio.h>
diff --git a/tests/test-glob.c b/tests/test-glob.c
index 750d9d8..976a3e5 100644
--- a/tests/test-glob.c
+++ b/tests/test-glob.c
@@ -20,6 +20,10 @@

 #include <glob.h>

+int (*signature_check1) (char const *, int, int (*) (char const *, int),
+                         glob_t *) = glob;
+void (*signature_check2) (glob_t *) = globfree;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-iconv.c b/tests/test-iconv.c
index e7e5742..2e5db0f 100644
--- a/tests/test-iconv.c
+++ b/tests/test-iconv.c
@@ -1,5 +1,5 @@
 /* Test of character set conversion.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,12 @@

 #if HAVE_ICONV
 # include <iconv.h>
+
+size_t (*signature_check1) (iconv_t, char **, size_t *, char **,
+                            size_t *) = iconv;
+int (*signature_check2) (iconv_t x) = iconv_close;
+iconv_t (*signature_check3) (char const *, char const *) = iconv_open;
+
 #endif

 #include <errno.h>
diff --git a/tests/test-inet_ntop.c b/tests/test-inet_ntop.c
index 312163a..c5bc7af 100644
--- a/tests/test-inet_ntop.c
+++ b/tests/test-inet_ntop.c
@@ -20,6 +20,9 @@

 #include <arpa/inet.h>

+char const *(*signature_check) (int, void const *, char *,
+                                socklen_t) = inet_ntop;
+
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <stdio.h>
diff --git a/tests/test-inet_pton.c b/tests/test-inet_pton.c
index dc6401e..fb3cb28 100644
--- a/tests/test-inet_pton.c
+++ b/tests/test-inet_pton.c
@@ -20,6 +20,8 @@

 #include <arpa/inet.h>

+int (*signature_check) (int, const char *, void *) = inet_pton;
+
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <stdio.h>
diff --git a/tests/test-isblank.c b/tests/test-isblank.c
index f25d26d..6f26f18 100644
--- a/tests/test-isblank.c
+++ b/tests/test-isblank.c
@@ -20,6 +20,8 @@

 #include <ctype.h>

+int (*signature_check) (int) = isblank;
+
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c
index 03f5cac..ad4f87d 100644
--- a/tests/test-isfinite.c
+++ b/tests/test-isfinite.c
@@ -1,5 +1,5 @@
 /* Test of isfinite() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -19,9 +19,15 @@

 #include <config.h>

+#include <math.h>
+
+/* isfinite must be a macro.  */
+#ifndef isfinite
+# error missing declaration
+#endif
+
 #include <float.h>
 #include <limits.h>
-#include <math.h>

 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-isinf.c b/tests/test-isinf.c
index dffd990..912d583 100644
--- a/tests/test-isinf.c
+++ b/tests/test-isinf.c
@@ -1,5 +1,5 @@
 /* Test of isinf() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -19,9 +19,15 @@

 #include <config.h>

+#include <math.h>
+
+/* isinf must be a macro.  */
+#ifndef isinf
+# error missing declaration
+#endif
+
 #include <float.h>
 #include <limits.h>
-#include <math.h>

 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-isnan.c b/tests/test-isnan.c
index e9dd5e3..74bb9d9 100644
--- a/tests/test-isnan.c
+++ b/tests/test-isnan.c
@@ -21,6 +21,11 @@

 #include <math.h>

+/* isnan must be a macro.  */
+#ifndef isnan
+# error missing declaration
+#endif
+
 #include <float.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/tests/test-lchown.c b/tests/test-lchown.c
index 78c2940..64a5711 100644
--- a/tests/test-lchown.c
+++ b/tests/test-lchown.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *, uid_t, gid_t) = lchown;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-ldexpl.c b/tests/test-ldexpl.c
index 42faf60..d54a952 100644
--- a/tests/test-ldexpl.c
+++ b/tests/test-ldexpl.c
@@ -20,6 +20,8 @@

 #include <math.h>

+long double (*signature_check) (long double, int) = ldexpl;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-link.c b/tests/test-link.c
index dd7df2e..41f1fb3 100644
--- a/tests/test-link.c
+++ b/tests/test-link.c
@@ -18,6 +18,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *, char const *) = link;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
diff --git a/tests/test-linkat.c b/tests/test-linkat.c
index 11233fe..91bc6b7 100644
--- a/tests/test-linkat.c
+++ b/tests/test-linkat.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int, char const *, int, char const *, int) = linkat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-lseek.c b/tests/test-lseek.c
index e474a0b..80a71a1 100644
--- a/tests/test-lseek.c
+++ b/tests/test-lseek.c
@@ -1,5 +1,5 @@
 /* Test of lseek() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -18,9 +18,12 @@

 #include <config.h>

+#include <unistd.h>
+
+off_t (*signature_check) (int, off_t, int) = lseek;
+
 #include <errno.h>
 #include <stdio.h>
-#include <unistd.h>

 #define ASSERT(expr) \
   do                                                                         \
diff --git a/tests/test-lstat.c b/tests/test-lstat.c
index 8c62bc1..c471368 100644
--- a/tests/test-lstat.c
+++ b/tests/test-lstat.c
@@ -20,6 +20,12 @@

 #include <sys/stat.h>

+/* Caution: lstat may be a function-like macro.  Although this
+   signature check must pass, it may be the signature of the real (and
+   broken) lstat rather than rpl_lstat.  Most code should not use the
+   address of lstat.  */
+int (*signature_check) (char const *, struct stat *) = lstat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-mbrtowc.c b/tests/test-mbrtowc.c
index 178e210..c0f1113 100644
--- a/tests/test-mbrtowc.c
+++ b/tests/test-mbrtowc.c
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,9 @@

 #include <wchar.h>

+size_t (*signature_check) (wchar_t *, char const *, size_t,
+                           mbstate_t *) = mbrtowc;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-mbsinit.c b/tests/test-mbsinit.c
index 392b853..6877007 100644
--- a/tests/test-mbsinit.c
+++ b/tests/test-mbsinit.c
@@ -1,5 +1,5 @@
 /* Test of test for initial conversion state.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,8 @@

 #include <wchar.h>

+int (*signature_check) (const mbstate_t *) = mbsinit;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-mbsnrtowcs.c b/tests/test-mbsnrtowcs.c
index 60a8e18..ee31b1f 100644
--- a/tests/test-mbsnrtowcs.c
+++ b/tests/test-mbsnrtowcs.c
@@ -1,5 +1,5 @@
 /* Test of conversion of string to wide string.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,9 @@

 #include <wchar.h>

+size_t (*signature_check) (wchar_t *, char const **, size_t, size_t,
+                           mbstate_t *) = mbsnrtowcs;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-mbsrtowcs.c b/tests/test-mbsrtowcs.c
index 49cb78a..fa37154 100644
--- a/tests/test-mbsrtowcs.c
+++ b/tests/test-mbsrtowcs.c
@@ -1,5 +1,5 @@
 /* Test of conversion of string to wide string.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,9 @@

 #include <wchar.h>

+size_t (*signature_check) (wchar_t *, char const **, size_t,
+                           mbstate_t *) = mbsrtowcs;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-memchr.c b/tests/test-memchr.c
index 582df89..4393c3b 100644
--- a/tests/test-memchr.c
+++ b/tests/test-memchr.c
@@ -19,6 +19,8 @@

 #include <string.h>

+void *(*signature_check) (void const *, int, size_t) = memchr;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-memcmp.c b/tests/test-memcmp.c
index 8740316..5c0e850 100644
--- a/tests/test-memcmp.c
+++ b/tests/test-memcmp.c
@@ -19,6 +19,8 @@

 #include <string.h>

+int (*signature_check) (void const *, void const *, size_t) = memcmp;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-memmem.c b/tests/test-memmem.c
index 75a2505..f33db0f 100644
--- a/tests/test-memmem.c
+++ b/tests/test-memmem.c
@@ -19,6 +19,8 @@

 #include <string.h>

+void *(*signature_check) (void const *, size_t, void const *, size_t) = memmem;
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c
index 17bc1f6..1d8d5d1 100644
--- a/tests/test-memrchr.c
+++ b/tests/test-memrchr.c
@@ -19,6 +19,8 @@

 #include <string.h>

+void *(*signature_check) (void const *, int, size_t) = memrchr;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-mkdir.c b/tests/test-mkdir.c
index 6a19c30..640339e 100644
--- a/tests/test-mkdir.c
+++ b/tests/test-mkdir.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (char const *, mode_t) = mkdir;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-mkdirat.c b/tests/test-mkdirat.c
index 9b59f17..2d92cbf 100644
--- a/tests/test-mkdirat.c
+++ b/tests/test-mkdirat.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (int, char const *, mode_t) = mkdirat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-mkfifo.c b/tests/test-mkfifo.c
index 3a0336c..51fc662 100644
--- a/tests/test-mkfifo.c
+++ b/tests/test-mkfifo.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (char const *, mode_t) = mkfifo;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-mkfifoat.c b/tests/test-mkfifoat.c
index fca3411..a73bccf 100644
--- a/tests/test-mkfifoat.c
+++ b/tests/test-mkfifoat.c
@@ -20,6 +20,9 @@

 #include <sys/stat.h>

+int (*signature_check1) (int, char const *, mode_t) = mkfifoat;
+int (*signature_check2) (int, char const *, mode_t, dev_t) = mknodat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-mknod.c b/tests/test-mknod.c
index 2e30883..082b214 100644
--- a/tests/test-mknod.c
+++ b/tests/test-mknod.c
@@ -20,6 +20,8 @@

 #include <sys/stat.h>

+int (*signature_check) (char const *, mode_t, dev_t) = mknod;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-nanosleep.c b/tests/test-nanosleep.c
index eb4bef6..b021299 100644
--- a/tests/test-nanosleep.c
+++ b/tests/test-nanosleep.c
@@ -20,6 +20,8 @@

 #include <time.h>

+int (*signature_check) (struct timespec const *, struct timepec *) = nanosleep;
+
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
diff --git a/tests/test-nl_langinfo.c b/tests/test-nl_langinfo.c
index 337e6ec..86d237f 100644
--- a/tests/test-nl_langinfo.c
+++ b/tests/test-nl_langinfo.c
@@ -20,6 +20,8 @@

 #include <langinfo.h>

+char *(*signature_check) (nl_item, locale_t) = nl_langinfo;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-obstack-printf.c b/tests/test-obstack-printf.c
index fdbdcfa..a7400df 100644
--- a/tests/test-obstack-printf.c
+++ b/tests/test-obstack-printf.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (struct obstack *, char const *, ...) = obstack_printf;
+
 #include "obstack.h"
 #include "xalloc.h"

diff --git a/tests/test-open.c b/tests/test-open.c
index 37109a5..5d8bd7c 100644
--- a/tests/test-open.c
+++ b/tests/test-open.c
@@ -20,6 +20,8 @@

 #include <fcntl.h>

+int (*signature_check) (char const *, int, ...) = open;
+
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
diff --git a/tests/test-openat.c b/tests/test-openat.c
index 77185cc..5f1709f 100644
--- a/tests/test-openat.c
+++ b/tests/test-openat.c
@@ -20,6 +20,8 @@

 #include <fcntl.h>

+int (*signature_check) (int, char const *, int, ...) = openat;
+
 #include <errno.h>
 #include <stdarg.h>
 #include <stdbool.h>
diff --git a/tests/test-perror.c b/tests/test-perror.c
index 2faa8ae..955eee5 100644
--- a/tests/test-perror.c
+++ b/tests/test-perror.c
@@ -1,5 +1,5 @@
 /* Test of perror() function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -19,6 +19,8 @@

 #include <stdio.h>

+void (*signature_check) (char const *) = perror;
+
 #include <errno.h>

 int
diff --git a/tests/test-pipe2.c b/tests/test-pipe2.c
index 049af5d..a9579dc 100644
--- a/tests/test-pipe2.c
+++ b/tests/test-pipe2.c
@@ -19,6 +19,8 @@

 #include <unistd.h>

+int (*signature_check) (int[2], int) = pipe2;
+
 #include <fcntl.h>
 #include <stdbool.h>

diff --git a/tests/test-poll.c b/tests/test-poll.c
index ed9bd9e..5949273 100644
--- a/tests/test-poll.c
+++ b/tests/test-poll.c
@@ -19,12 +19,15 @@

 #include <config.h>

+#include <poll.h>
+
+int (*signature_check) (struct pollfd[], nfds_t, int) = poll;
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <poll.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <stdbool.h>
diff --git a/tests/test-popen.c b/tests/test-popen.c
index 342e363..46fcabc 100644
--- a/tests/test-popen.c
+++ b/tests/test-popen.c
@@ -21,4 +21,7 @@
 /* Specification.  */
 #include <stdio.h>

+FILE *(*signature_check1) (char const *, char const *) = popen;
+int (*signature_check2) (FILE *) = pclose;
+
 #include "test-popen.h"
diff --git a/tests/test-posix_spawn1.c b/tests/test-posix_spawn1.c
index 896c7c9..dfb255e 100644
--- a/tests/test-posix_spawn1.c
+++ b/tests/test-posix_spawn1.c
@@ -20,6 +20,27 @@

 #include <spawn.h>

+int (*signature_check1) (pid_t *, char const *,
+                         posix_spawn_file_actions_t const *,
+                         posix_spawnattr_t const *, char *const[],
+                         char *const[]) = posix_spawnp;
+int (*signature_check2) (posix_spawnattr_t *) = posix_spawnattr_init;
+int (*signature_check3) (posix_spawnattr_t *) = posix_spawnattr_destroy;
+int (*signature_check4) (posix_spawnattr_t *,
+                         sigset_t const *) = posix_spawnattr_setsigmask;
+int (*signature_check5) (posix_spawnattr_t *,
+                         short) = posix_spawnattr_setflags;
+int (*signature_check6) (posix_spawn_file_actions_t *)
+  = posix_spawn_file_actions_init;
+int (*signature_check7) (posix_spawn_file_actions_t *)
+  = posix_spawn_file_actions_destroy;
+int (*signature_check8) (posix_spawn_file_actions_t *,
+                         int) = posix_spawn_file_actions_addclose;
+int (*signature_check9) (posix_spawn_file_actions_t *, int, char const *, int,
+                         mode_t) = posix_spawn_file_actions_addopen;
+int (*signature_check10) (posix_spawn_file_actions_t *, int,
+                         int) = posix_spawn_file_actions_adddup2;
+
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
diff --git a/tests/test-posix_spawn3.c b/tests/test-posix_spawn3.c
index af71068..e3d6b03 100644
--- a/tests/test-posix_spawn3.c
+++ b/tests/test-posix_spawn3.c
@@ -23,6 +23,10 @@

 #include <spawn.h>

+int (*signature_check) (pid_t *, char const *,
+                        posix_spawn_file_actions_t const *,
+                        posix_spawnattr_t const *, char *const[],
+                        char *const[]) = posix_spawn;
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
diff --git a/tests/test-pread.c b/tests/test-pread.c
index 0ef387d..661e93f 100644
--- a/tests/test-pread.c
+++ b/tests/test-pread.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+ssize_t (*signature_check) (int, void *, size_t, off_t) = pread;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
diff --git a/tests/test-printf-posix.c b/tests/test-printf-posix.c
index 51f1bf7..3c485a7 100644
--- a/tests/test-printf-posix.c
+++ b/tests/test-printf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible printf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char const *, ...) = printf;
+
 #include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
diff --git a/tests/test-pty.c b/tests/test-pty.c
index cd24f0d..c90098a 100644
--- a/tests/test-pty.c
+++ b/tests/test-pty.c
@@ -20,6 +20,11 @@

 #include <pty.h>

+int (*signature_check1) (int *, int *, char *, strcut termios *,
+                         struct winsize *) = openpty;
+int (*signature_check2) (int *, char *, struct termios *,
+                         struct winsize *) = forkpty;
+
 #include <stdio.h>

 int
diff --git a/tests/test-random_r.c b/tests/test-random_r.c
index 7488543..d07cc1d 100644
--- a/tests/test-random_r.c
+++ b/tests/test-random_r.c
@@ -1,5 +1,5 @@
 /* Test random_r.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -15,7 +15,15 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

 #include <config.h>
+
 #include <stdlib.h>
+
+int (*signature_check1) (unsigned int, struct random_data *) = srandom_r;
+int (*signature_check2) (unsigned int, char *, size_t,
+                         struct random_data *) = initstate_r;
+int (*signature_check3) (char *, struct random_data *) = setstate_r;
+int (*signature_check4) (struct random_data *, int32_t *) = random_r;
+
 #include <stdio.h>
 #include <time.h>

diff --git a/tests/test-rawmemchr.c b/tests/test-rawmemchr.c
index eece65f..1eb296d 100644
--- a/tests/test-rawmemchr.c
+++ b/tests/test-rawmemchr.c
@@ -19,6 +19,8 @@

 #include <string.h>

+void *(*signature_check) (void const *, int) = rawmemchr;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-readlink.c b/tests/test-readlink.c
index 5e51cb6..52dd8eb 100644
--- a/tests/test-readlink.c
+++ b/tests/test-readlink.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+ssize_t (*signature_check) (char const *, char *, size_t) = readlink;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-remove.c b/tests/test-remove.c
index 7781dfc..17dfd13 100644
--- a/tests/test-remove.c
+++ b/tests/test-remove.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char const *) = remove;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/tests/test-rename.c b/tests/test-rename.c
index 0d51140..73805cc 100644
--- a/tests/test-rename.c
+++ b/tests/test-rename.c
@@ -16,12 +16,13 @@

 #include <config.h>

-#include <unistd.h>
+#include <stdio.h>
+
+int (*signature_check) (char const *, char const *) = rename;

 #include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
diff --git a/tests/test-renameat.c b/tests/test-renameat.c
index 7cde7be..56a09b1 100644
--- a/tests/test-renameat.c
+++ b/tests/test-renameat.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (int, char const *, int, char const *) = renameat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-rmdir.c b/tests/test-rmdir.c
index 908b0e6..8fd4983 100644
--- a/tests/test-rmdir.c
+++ b/tests/test-rmdir.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *) = rmdir;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-round1.c b/tests/test-round1.c
index 8e9e0ef..299f7ca 100644
--- a/tests/test-round1.c
+++ b/tests/test-round1.c
@@ -1,5 +1,5 @@
 /* Test of rounding to nearest, breaking ties away from zero.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -22,6 +22,8 @@

 #include <math.h>

+double (*signature_check) (double) = round;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-roundf1.c b/tests/test-roundf1.c
index cbf3f9e..a65b20c 100644
--- a/tests/test-roundf1.c
+++ b/tests/test-roundf1.c
@@ -1,5 +1,5 @@
 /* Test of rounding to nearest, breaking ties away from zero.
-   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008, 2009 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
@@ -22,6 +22,8 @@

 #include <math.h>

+float (*signature_check) (float) = roundf;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-roundl.c b/tests/test-roundl.c
index c4fcf0c..76aba1a 100644
--- a/tests/test-roundl.c
+++ b/tests/test-roundl.c
@@ -22,6 +22,8 @@

 #include <math.h>

+long double (*signature_check) (long double) = roundl;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-select.c b/tests/test-select.c
index 5ce7c7f..6d19083 100644
--- a/tests/test-select.c
+++ b/tests/test-select.c
@@ -20,6 +20,11 @@

 #include <sys/select.h>

+int (*signature_check) (int, fd_set *, fd_set *, fd_set *,
+                        struct timeval *) = select;
+/* Unspecified whether FD_CLR, FD_ISSET, FD_SET, and FD_ZERO are
+   macros or functions.  */
+
 #include <stdio.h>
 #include <string.h>
 #include <netinet/in.h>
diff --git a/tests/test-setenv.c b/tests/test-setenv.c
index eb1fe33..d22fcaa 100644
--- a/tests/test-setenv.c
+++ b/tests/test-setenv.c
@@ -20,6 +20,8 @@

 #include <stdlib.h>

+int (*signature_check) (char const *, char const *, int) = setenv;
+
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/tests/test-sigaction.c b/tests/test-sigaction.c
index 55da288..7904700 100644
--- a/tests/test-sigaction.c
+++ b/tests/test-sigaction.c
@@ -20,6 +20,9 @@

 #include <signal.h>

+int (*signature_check) (int, struct sigaction const *,
+                        struct sigaction *) = sigaction;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-signbit.c b/tests/test-signbit.c
index acca7fd..4acb045 100644
--- a/tests/test-signbit.c
+++ b/tests/test-signbit.c
@@ -20,6 +20,11 @@

 #include <math.h>

+/* signbit must be a macro.  */
+#ifndef signbit
+# error missing declaration
+#endif
+
 #include <float.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/tests/test-sleep.c b/tests/test-sleep.c
index 48abce1..065df99 100644
--- a/tests/test-sleep.c
+++ b/tests/test-sleep.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+unsigned int (*signature_check) (unsigned int) = sleep;
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-snprintf.c b/tests/test-snprintf.c
index 55bca33..db3a2c7 100644
--- a/tests/test-snprintf.c
+++ b/tests/test-snprintf.c
@@ -1,5 +1,5 @@
 /* Test of snprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char *, size_t, char const *, ...) = snprintf;
+
 #include <stdlib.h>
 #include <string.h>

diff --git a/tests/test-sprintf-posix.c b/tests/test-sprintf-posix.c
index e5dab35..091699b 100644
--- a/tests/test-sprintf-posix.c
+++ b/tests/test-sprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible sprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char *, char const *, ...) = sprintf;
+
 #include <float.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/test-stat.c b/tests/test-stat.c
index fc11731..31af4e2 100644
--- a/tests/test-stat.c
+++ b/tests/test-stat.c
@@ -20,6 +20,12 @@

 #include <sys/stat.h>

+/* Caution: stat may be a function-like macro.  Although this
+   signature check must pass, it may be the signature of the real (and
+   broken) stat rather than rpl_stat.  Most code should not use the
+   address of stat.  */
+int (*signature_check) (char const *, struct stat *) = stat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-stpncpy.c b/tests/test-stpncpy.c
index 128bee3..5cc6ef8 100644
--- a/tests/test-stpncpy.c
+++ b/tests/test-stpncpy.c
@@ -1,5 +1,5 @@
 /* Test the system defined function stpncpy().
-   Copyright (C) 2003, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008, 2009 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
@@ -17,6 +17,9 @@
 #include <config.h>

 #include <string.h>
+
+char *(*signature_check) (char *, char const *, size_t) = stpncpy;
+
 #include <stdio.h>

 int
diff --git a/tests/test-strcasestr.c b/tests/test-strcasestr.c
index 8ecd3a9..33e62c1 100644
--- a/tests/test-strcasestr.c
+++ b/tests/test-strcasestr.c
@@ -1,5 +1,5 @@
 /* Test of case-insensitive searching in a string.
-   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008, 2009 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
@@ -20,6 +20,8 @@

 #include <string.h>

+char *(*signature_check) (char const *, char const *) = strcasestr;
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-strchrnul.c b/tests/test-strchrnul.c
index ea882e5..a840e03 100644
--- a/tests/test-strchrnul.c
+++ b/tests/test-strchrnul.c
@@ -19,6 +19,8 @@

 #include <string.h>

+char *(*signature_check) (char const *, int) = strchrnul;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-strerror.c b/tests/test-strerror.c
index ba23edc..864ce7b 100644
--- a/tests/test-strerror.c
+++ b/tests/test-strerror.c
@@ -19,10 +19,13 @@

 #include <config.h>

+#include <string.h>
+
+char *(*signature_check) (int) = strerror;
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>

 #define ASSERT(expr) \
   do                                                                         \
diff --git a/tests/test-strsignal.c b/tests/test-strsignal.c
index 3b362dd..47c7b17 100644
--- a/tests/test-strsignal.c
+++ b/tests/test-strsignal.c
@@ -19,10 +19,13 @@

 #include <config.h>

+#include <string.h>
+
+char *(*signature_check) (int) = strsignal;
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>

 #define ASSERT(expr) \
   do                                                                         \
diff --git a/tests/test-strstr.c b/tests/test-strstr.c
index c89a1ac..88fefe9 100644
--- a/tests/test-strstr.c
+++ b/tests/test-strstr.c
@@ -19,6 +19,8 @@

 #include <string.h>

+char *(*signature_check) (char const *, char const *) = strstr;
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-strtod.c b/tests/test-strtod.c
index 14f73b9..eadde5b 100644
--- a/tests/test-strtod.c
+++ b/tests/test-strtod.c
@@ -19,6 +19,8 @@

 #include <stdlib.h>

+double (*signature_check) (char const *, char **) = strtod;
+
 #include <errno.h>
 #include <float.h>
 #include <math.h>
diff --git a/tests/test-strverscmp.c b/tests/test-strverscmp.c
index 220f2d6..03c4d67 100644
--- a/tests/test-strverscmp.c
+++ b/tests/test-strverscmp.c
@@ -21,6 +21,8 @@

 #include <string.h>

+int (*signature_check) (const char *, const char *) = strverscmp;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-symlink.c b/tests/test-symlink.c
index 4b593b6..d4b0682 100644
--- a/tests/test-symlink.c
+++ b/tests/test-symlink.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *, char const *) = symlink;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-symlinkat.c b/tests/test-symlinkat.c
index c76244f..017b624 100644
--- a/tests/test-symlinkat.c
+++ b/tests/test-symlinkat.c
@@ -20,6 +20,9 @@

 #include <unistd.h>

+int (*signature_check1) (char const *, int, char const *) = symlinkat;
+ssize_t (*signature_check2) (int, char const *, char *, size_t) = readlinkat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-times.c b/tests/test-times.c
index 496b9a8..2b1a7dd 100644
--- a/tests/test-times.c
+++ b/tests/test-times.c
@@ -1,5 +1,5 @@
 /* Test of times function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -19,6 +19,9 @@
 #include <config.h>

 #include <sys/times.h>
+
+clock_t (*signature_check) (struct tms *) = times;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
diff --git a/tests/test-trunc1.c b/tests/test-trunc1.c
index 671d3f5..132fc7d 100644
--- a/tests/test-trunc1.c
+++ b/tests/test-trunc1.c
@@ -1,5 +1,5 @@
 /* Test of rounding towards zero.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <math.h>

+double (*signature_check) (double) = trunc;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-truncf1.c b/tests/test-truncf1.c
index 834899b..185cbbf 100644
--- a/tests/test-truncf1.c
+++ b/tests/test-truncf1.c
@@ -1,5 +1,5 @@
 /* Test of rounding towards zero.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <math.h>

+float (*signature_check) (float) = truncf;
+
 #include <stdio.h>
 #include <stdlib.h>

diff --git a/tests/test-truncl.c b/tests/test-truncl.c
index 7e3dd17..fef1a1c 100644
--- a/tests/test-truncl.c
+++ b/tests/test-truncl.c
@@ -20,6 +20,8 @@

 #include <math.h>

+long double (*signature_check) (long double) = truncl;
+
 #include <float.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-tsearch.c b/tests/test-tsearch.c
index 273f3ab..07bfaab 100644
--- a/tests/test-tsearch.c
+++ b/tests/test-tsearch.c
@@ -1,5 +1,5 @@
 /* Test program for tsearch et al.
-   Copyright (C) 1997, 2000-2001, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2000-2001, 2007-2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.

    The GNU C Library is free software: you can redistribute it and/or
@@ -19,6 +19,15 @@

 #include <search.h>

+void *(*signature_check1) (void const *, void **,
+                           int (*) (void const *, void const *)) = tdelete;
+void *(*signature_check2) (void const *, void * const *,
+                           int (*) (void const *, void const *)) = tfind;
+void *(*signature_check3) (void const *, void **,
+                           int (*) (void const *, void const *)) = tsearch;
+void (*signature_check4) (void const *,
+                          void (*) (void const *, VISIT, int)) = twalk;
+
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-uname.c b/tests/test-uname.c
index a458698..e762167 100644
--- a/tests/test-uname.c
+++ b/tests/test-uname.c
@@ -20,6 +20,8 @@

 #include <sys/utsname.h>

+int (*signature_check) (struct utsname *) = uname;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-unlink.c b/tests/test-unlink.c
index 447a014..b4ba28f 100644
--- a/tests/test-unlink.c
+++ b/tests/test-unlink.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (char const *) = unlink;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-unlinkat.c b/tests/test-unlinkat.c
index a98dc8d..e32a743 100644
--- a/tests/test-unlinkat.c
+++ b/tests/test-unlinkat.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (int, char const *, int) = unlinkat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-unsetenv.c b/tests/test-unsetenv.c
index 2815cf3..7de8713 100644
--- a/tests/test-unsetenv.c
+++ b/tests/test-unsetenv.c
@@ -20,6 +20,8 @@

 #include <stdlib.h>

+int (*signature_check) (char const *) = unsetenv;
+
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/tests/test-usleep.c b/tests/test-usleep.c
index d6e62eb..b2c47aa 100644
--- a/tests/test-usleep.c
+++ b/tests/test-usleep.c
@@ -20,6 +20,8 @@

 #include <unistd.h>

+int (*signature_check) (useconds_t) = usleep;
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
diff --git a/tests/test-utimensat.c b/tests/test-utimensat.c
index 35fd1bf..7770efa 100644
--- a/tests/test-utimensat.c
+++ b/tests/test-utimensat.c
@@ -20,6 +20,9 @@

 #include <sys/stat.h>

+int (*signature_check) (int, char const *, struct timespec const[2],
+                        int) = utimensat;
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
diff --git a/tests/test-vasprintf.c b/tests/test-vasprintf.c
index a85ff8e..f8c9845 100644
--- a/tests/test-vasprintf.c
+++ b/tests/test-vasprintf.c
@@ -1,5 +1,5 @@
 /* Test of vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,9 @@

 #include <stdio.h>

+int (*signature_check1) (char **, char const *, ...) = asprintf;
+int (*signature_check2) (char **, char const *, va_list) = vasprintf;
+
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-vdprintf-posix.c b/tests/test-vdprintf-posix.c
index 949665e..b1d59d4 100644
--- a/tests/test-vdprintf-posix.c
+++ b/tests/test-vdprintf-posix.c
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (int, char const *, va_list) = vdprintf;
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/test-vfprintf-posix.c b/tests/test-vfprintf-posix.c
index ae94fa7..1329d54 100644
--- a/tests/test-vfprintf-posix.c
+++ b/tests/test-vfprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vfprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (FILE *, char const *, va_list) = vfprintf;
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/test-vprintf-posix.c b/tests/test-vprintf-posix.c
index 8522283..fa014ec 100644
--- a/tests/test-vprintf-posix.c
+++ b/tests/test-vprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vfprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char const *, va_list) = vprintf;
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/test-vsnprintf.c b/tests/test-vsnprintf.c
index f0d08ed..5806c74 100644
--- a/tests/test-vsnprintf.c
+++ b/tests/test-vsnprintf.c
@@ -1,5 +1,5 @@
 /* Test of vsnprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char *, size_t, char const *, va_list) = vsnprintf;
+
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tests/test-vsprintf-posix.c b/tests/test-vsprintf-posix.c
index 3bb457f..138b9a1 100644
--- a/tests/test-vsprintf-posix.c
+++ b/tests/test-vsprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vsprintf() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <stdio.h>

+int (*signature_check) (char *, char const *, va_list) = vsprintf;
+
 #include <float.h>
 #include <stdarg.h>
 #include <stddef.h>
diff --git a/tests/test-wcrtomb.c b/tests/test-wcrtomb.c
index 4fe972b..49d2bd5 100644
--- a/tests/test-wcrtomb.c
+++ b/tests/test-wcrtomb.c
@@ -1,5 +1,5 @@
 /* Test of conversion of wide character to multibyte character.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,8 @@

 #include <wchar.h>

+size_t (*signature_check) (char *, wchar_t, mbstate_t *) = wcrtomb;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-wcsnrtombs.c b/tests/test-wcsnrtombs.c
index 38c0441..748757e 100644
--- a/tests/test-wcsnrtombs.c
+++ b/tests/test-wcsnrtombs.c
@@ -1,5 +1,5 @@
 /* Test of conversion of wide string to string.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,9 @@

 #include <wchar.h>

+size_t (*signature_check) (char *, wchar_t const **, size_t, size_t,
+                           mbstate_t *) = wcsnrtombs;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-wcsrtombs.c b/tests/test-wcsrtombs.c
index 3ceb7c0..6d8d745 100644
--- a/tests/test-wcsrtombs.c
+++ b/tests/test-wcsrtombs.c
@@ -1,5 +1,5 @@
 /* Test of conversion of wide string to string.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
@@ -20,6 +20,9 @@

 #include <wchar.h>

+size_t (*signature_check) (char *, wchar_t const **, size_t,
+                           mbstate_t *) = wcsrtombs;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/test-wcwidth.c b/tests/test-wcwidth.c
index 5087b08..3f1d5d8 100644
--- a/tests/test-wcwidth.c
+++ b/tests/test-wcwidth.c
@@ -1,5 +1,5 @@
 /* Test of wcwidth() function.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 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
@@ -20,6 +20,8 @@

 #include <wchar.h>

+int (*signature_check) (wchar_t) = wcwidth;
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
-- 
1.6.4.2








reply via email to

[Prev in Thread] Current Thread [Next in Thread]