1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

New module 'arg-nonnull'. Declare which arguments expect non-NULL values.

This commit is contained in:
Bruno Haible
2009-12-11 01:15:28 +01:00
parent 441aa3044f
commit 6948250861
70 changed files with 751 additions and 268 deletions

161
ChangeLog
View File

@@ -1,3 +1,164 @@
2009-12-10 Bruno Haible <bruno@clisp.org>
Declare which arguments expect non-NULL values, for GCC and clang.
* build-aux/arg-nonnull.h: New file.
* modules/arg-nonnull: New file.
* lib/arpa_inet.in.h (_GL_ARG_NONNULL): New placeholder.
(inet_ntop, inet_pton): Use it.
* lib/dirent.in.h (_GL_ARG_NONNULL): New placeholder.
(closedir, dirfd, opendir, scandir, alphasort): Use it.
* lib/fcntl.in.h (_GL_ARG_NONNULL): New placeholder.
(open, openat): Use it.
* lib/fnmatch.in.h (_GL_ARG_NONNULL): New placeholder.
(fnmatch): Use it.
* lib/getopt.in.h (_GL_ARG_NONNULL): New placeholder.
(getopt, getopt_long, getopt_long_only): Use it.
* lib/glob.in.h (_GL_ARG_NONNULL): New placeholder.
* lib/glob-libc.h (glob, globfree, glob64, globfree64, glob_pattern_p):
Use it.
* lib/iconv.in.h (_GL_ARG_NONNULL): New placeholder.
(iconv_open): Use it.
* lib/inttypes.in.h (_GL_ARG_NONNULL): New placeholder.
(strtoimax, strtoumax): Use it.
* lib/locale.in.h (_GL_ARG_NONNULL): New placeholder.
(duplocale): Use it.
* lib/math.in.h (_GL_ARG_NONNULL): New placeholder.
(frexp, frexpl): Use it.
* lib/netdb.in.h (_GL_ARG_NONNULL): New placeholder.
(getaddrinfo, freeaddrinfo, getnameinfo): Use it.
* lib/search.in.h (_GL_ARG_NONNULL): New placeholder.
(tsearch, tfind, tdelete, twalk): Use it.
* lib/signal.in.h (_GL_ARG_NONNULL): New placeholder.
(sigismember, sigemptyset, sigaddset, sigdelset, sigfillset,
sigpending): Use it.
* lib/spawn.in.h (_GL_ARG_NONNULL): New placeholder.
(posix_spawn, posix_spawnp, posix_spawnattr_init,
posix_spawnattr_destroy, posix_spawnattr_getsigdefault,
posix_spawnattr_setsigdefault, posix_spawnattr_getsigmask,
posix_spawnattr_setsigmask, posix_spawnattr_getflags,
posix_spawnattr_setflags, posix_spawnattr_getpgroup,
posix_spawnattr_setpgroup, posix_spawnattr_getschedpolicy,
posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam,
posix_spawnattr_setschedparam, posix_spawn_file_actions_init,
posix_spawn_file_actions_destroy, posix_spawn_file_actions_addopen,
posix_spawn_file_actions_addclose, posix_spawn_file_actions_adddup2):
Use it.
* lib/stdio.in.h (_GL_ARG_NONNULL): New placeholder.
(dprintf, fclose, fopen, fprintf, fpurge, fputc, fputs, freopen,
rpl_fseek, fseeko, rpl_ftell, ftello, fwrite, getdelim, getline,
obstack_printf, obstack_vprintf, popen, printf, putc, puts, remove,
rename, renameat, snprintf, sprintf, asprintf, vasprintf, vdprintf,
vfprintf, vprintf, vsnprintf, vsprintf): Use it.
* lib/stdlib.in.h (_GL_ARG_NONNULL): New placeholder.
(atoll, canonicalize_file_name, getloadavg, getsubopt, mkdtemp,
mkostemp, mkostemps, mkstemp, mkstemps, putenv, srandom_r, initstate_r,
setstate_r, random_r, realpath, rpmatch, setenv, strtod, strtoll,
strtoull, unsetenv): Use it.
* lib/string.in.h (_GL_ARG_NONNULL): New placeholder.
(memchr, memmem, mempcpy, memrchr, rawmemchr, stpcpy, stpncpy,
strchrnul, strdup, strndup, strnlen, strpbrk, strsep, strstr,
strcasestr, strtok_r, mbslen, mbsnlen, mbschr, mbsrchr, mbsstr,
mbscasecmp, mbsncasecmp, mbspcasecmp, mbscasestr, mbscspn, mbspbrk,
mbsspn, mbssep, mbstok_r, strverscmp): Use it.
* lib/strings.in.h (_GL_ARG_NONNULL): New placeholder.
(strcasecmp, strncasecmp): Use it.
* lib/sys_socket.in.h (_GL_ARG_NONNULL): New placeholder.
(rpl_connect, rpl_bind, rpl_getpeername, rpl_getsockname,
rpl_getsockopt, rpl_recv, rpl_send, rpl_recvfrom, rpl_sendto,
rpl_setsockopt): Use it.
* lib/sys_stat.in.h (_GL_ARG_NONNULL): New placeholder.
(fchmodat, fstat, fstatat, lchmod, rpl_lstat, mkdir, mkdirat, mkfifo,
mkfifoat, mknod, mknodat, stat, utimensat): Use it.
* lib/sys_time.in.h (_GL_ARG_NONNULL): New placeholder.
(gettimeofday): Use it.
* lib/sys_times.in.h (_GL_ARG_NONNULL): New placeholder.
(times): Use it.
* lib/sys_utsname.in.h (_GL_ARG_NONNULL): New placeholder.
(uname): Use it.
* lib/time.in.h (_GL_ARG_NONNULL): New placeholder.
(nanosleep, mktime, localtime_r, gmtime_r, strptime, timegm): Use it.
* lib/unistd.in.h (_GL_ARG_NONNULL): New placeholder.
(chown, euidaccess, faccessat, _gl_register_fd, fchownat,
getdomainname, gethostname, getlogin_r, lchown, link, linkat, pipe2,
pread, readlink, readlinkat, rmdir, symlink, symlinkat, unlink,
unlinkat, write): Use it.
* lib/wchar.in.h (_GL_ARG_NONNULL): New placeholder.
(mbsrtowcs, mbsnrtowcs, wcsrtombs, wcsnrtombs): Use it.
* lib/argv-iter.h: Include arg-nonnull.h.
(_ATTRIBUTE_NONNULL_): Remove macro.
(argv_iter_init_argv, argv_iter_init_stream, argv_iter,
argv_iter_n_args, argv_iter_free): Use _GL_ARG_NONNULL.
* lib/canonicalize-lgpl.c (_GL_ARG_NONNULL): Define, to defeat gcc
optimization.
* lib/getaddrinfo.c (_GL_ARG_NONNULL): Likewise.
* lib/getdelim.c (_GL_ARG_NONNULL): Likewise.
* lib/glob.c (_GL_ARG_NONNULL): Likewise.
* lib/random_r.c (_GL_ARG_NONNULL): Likewise.
* lib/setenv.c (_GL_ARG_NONNULL): Likewise.
* lib/strtod.c (_GL_ARG_NONNULL): Likewise.
* lib/tsearch.c (_GL_ARG_NONNULL): Likewise.
* lib/unsetenv.c (_GL_ARG_NONNULL): Likewise.
* modules/arpa_inet (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into arpa/inet.h.
* modules/dirent (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into dirent.h.
* modules/fcntl-h (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into fcntl.h.
* modules/fnmatch (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into fnmatch.h.
* modules/getopt-posix (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into getopt.h.
* modules/glob (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into glob.h.
* modules/iconv_open (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into iconv.h.
* modules/inttypes (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into inttypes.h.
* modules/locale (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into locale.h.
* modules/math (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into math.h.
* modules/netdb (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into netdb.h.
* modules/search (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into search.h.
* modules/signal (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into signal.h.
* modules/spawn (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into spawn.h.
* modules/stdio (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into stdio.h.
* modules/stdlib (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into stdlib.h.
* modules/string (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into string.h.
* modules/strings (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into strings.h.
* modules/sys_socket (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into sys/socket.h.
* modules/sys_stat (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into sys/stat.h.
* modules/sys_time (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into sys/time.h.
* modules/sys_times (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into sys/times.h.
* modules/sys_utsname (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into sys/utsname.h.
* modules/time (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into time.h.
* modules/unistd (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into unistd.h.
* modules/wchar (Depends-on): Add arg-nonnull.
(Makefile.am): Insert arg-nonnull.h into wchar.h.
* modules/argv-iter (Depends-on): Add arg-nonnull.
* tests/test-canonicalize.c (null_ptr): New function.
(main): Use it.
* tests/test-canonicalize-lgpl.c (null_ptr): New function.
(main): Use it.
* tests/test-memmem.c (null_ptr): New function.
(main): Use it.
Reported by Jim Meyering.
2009-12-10 Bruno Haible <bruno@clisp.org> 2009-12-10 Bruno Haible <bruno@clisp.org>
Use spaces for indentation, not tabs. Use spaces for indentation, not tabs.

26
build-aux/arg-nonnull.h Normal file
View File

@@ -0,0 +1,26 @@
/* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
that the values passed as arguments n, ..., m must be non-NULL pointers.
n = 1 stands for the first argument, n = 2 for the second argument etc. */
#ifndef _GL_ARG_NONNULL
# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
# else
# define _GL_ARG_NONNULL(params)
# endif
#endif

View File

@@ -17,16 +17,12 @@
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
/* Definition of _GL_ARG_NONNULL. */
#include "arg-nonnull.h"
struct argv_iterator; struct argv_iterator;
enum argv_iter_err; enum argv_iter_err;
#undef _ATTRIBUTE_NONNULL_
#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
#else
# define _ATTRIBUTE_NONNULL_(m)
#endif
enum argv_iter_err enum argv_iter_err
{ {
AI_ERR_OK = 1, AI_ERR_OK = 1,
@@ -36,12 +32,12 @@ enum argv_iter_err
}; };
struct argv_iterator *argv_iter_init_argv (char **argv) struct argv_iterator *argv_iter_init_argv (char **argv)
_ATTRIBUTE_NONNULL_ (1); _GL_ARG_NONNULL ((1));
struct argv_iterator *argv_iter_init_stream (FILE *fp) struct argv_iterator *argv_iter_init_stream (FILE *fp)
_ATTRIBUTE_NONNULL_ (1); _GL_ARG_NONNULL ((1));
char *argv_iter (struct argv_iterator *, enum argv_iter_err *) char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
_ATTRIBUTE_NONNULL_ (1) _ATTRIBUTE_NONNULL_ (2); _GL_ARG_NONNULL ((1, 2));
size_t argv_iter_n_args (struct argv_iterator const *) size_t argv_iter_n_args (struct argv_iterator const *)
_ATTRIBUTE_NONNULL_ (1); _GL_ARG_NONNULL ((1));
void argv_iter_free (struct argv_iterator *) void argv_iter_free (struct argv_iterator *)
_ATTRIBUTE_NONNULL_ (1); _GL_ARG_NONNULL ((1));

View File

@@ -1,6 +1,6 @@
/* A GNU-like <arpa/inet.h>. /* A GNU-like <arpa/inet.h>.
Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc. Copyright (C) 2005-2006, 2008-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -38,6 +38,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -60,7 +62,8 @@ extern "C" {
For more details, see the POSIX:2001 specification For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
extern const char *inet_ntop (int af, const void *restrict src, extern const char *inet_ntop (int af, const void *restrict src,
char *restrict dst, socklen_t cnt); char *restrict dst, socklen_t cnt)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef inet_ntop # undef inet_ntop
@@ -72,7 +75,8 @@ extern const char *inet_ntop (int af, const void *restrict src,
#if @GNULIB_INET_PTON@ #if @GNULIB_INET_PTON@
# if !@HAVE_DECL_INET_PTON@ # if !@HAVE_DECL_INET_PTON@
extern int inet_pton (int af, const char *restrict src, void *restrict dst); extern int inet_pton (int af, const char *restrict src, void *restrict dst)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef inet_pton # undef inet_pton

View File

@@ -21,6 +21,10 @@
#if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC #if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the name == NULL test below. */
#define _GL_ARG_NONNULL(params)
/* Specification. */ /* Specification. */
#include <stdlib.h> #include <stdlib.h>

View File

@@ -28,6 +28,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -37,14 +39,14 @@ extern "C" {
#if @REPLACE_CLOSEDIR@ #if @REPLACE_CLOSEDIR@
# define closedir rpl_closedir # define closedir rpl_closedir
extern int closedir (DIR *); extern int closedir (DIR *) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_DIRFD@ #if @GNULIB_DIRFD@
# if !@HAVE_DECL_DIRFD@ && !defined dirfd # if !@HAVE_DECL_DIRFD@ && !defined dirfd
/* Return the file descriptor associated with the given directory stream, /* Return the file descriptor associated with the given directory stream,
or -1 if none exists. */ or -1 if none exists. */
extern int dirfd (DIR const *dir); extern int dirfd (DIR const *dir) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef dirfd # undef dirfd
@@ -77,7 +79,7 @@ extern DIR *fdopendir (int fd);
#if @REPLACE_OPENDIR@ #if @REPLACE_OPENDIR@
# define opendir rpl_opendir # define opendir rpl_opendir
extern DIR * opendir (const char *); extern DIR * opendir (const char *) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_SCANDIR@ #if @GNULIB_SCANDIR@
@@ -88,7 +90,8 @@ extern DIR * opendir (const char *);
# if !@HAVE_SCANDIR@ # if !@HAVE_SCANDIR@
extern int scandir (const char *dir, struct dirent ***namelist, extern int scandir (const char *dir, struct dirent ***namelist,
int (*filter) (const struct dirent *), int (*filter) (const struct dirent *),
int (*cmp) (const struct dirent **, const struct dirent **)); int (*cmp) (const struct dirent **, const struct dirent **))
_GL_ARG_NONNULL ((1, 2, 4));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef scandir # undef scandir
@@ -101,7 +104,8 @@ extern int scandir (const char *dir, struct dirent ***namelist,
#if @GNULIB_ALPHASORT@ #if @GNULIB_ALPHASORT@
/* Compare two 'struct dirent' entries alphabetically. */ /* Compare two 'struct dirent' entries alphabetically. */
# if !@HAVE_ALPHASORT@ # if !@HAVE_ALPHASORT@
extern int alphasort (const struct dirent **, const struct dirent **); extern int alphasort (const struct dirent **, const struct dirent **)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef alphasort # undef alphasort

View File

@@ -46,6 +46,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Declare overridden functions. */ /* Declare overridden functions. */
@@ -57,7 +59,7 @@ extern "C" {
# if @REPLACE_OPEN@ # if @REPLACE_OPEN@
# undef open # undef open
# define open rpl_open # define open rpl_open
extern int open (const char *filename, int flags, ...); extern int open (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -67,7 +69,8 @@ extern int open (const char *filename, int flags, ...);
# define openat rpl_openat # define openat rpl_openat
# endif # endif
# if !@HAVE_OPENAT@ || @REPLACE_OPENAT@ # if !@HAVE_OPENAT@ || @REPLACE_OPENAT@
int openat (int fd, char const *file, int flags, /* mode_t mode */ ...); int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef openat # undef openat

View File

@@ -1,5 +1,5 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003, /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
2005, 2007 Free Software Foundation, Inc. 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@@ -20,6 +20,8 @@
#ifndef _FNMATCH_H #ifndef _FNMATCH_H
#define _FNMATCH_H 1 #define _FNMATCH_H 1
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -56,7 +58,8 @@ extern "C" {
/* Match NAME against the file name pattern PATTERN, /* Match NAME against the file name pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */ returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch (const char *__pattern, const char *__name, extern int fnmatch (const char *__pattern, const char *__name,
int __flags); int __flags)
_GL_ARG_NONNULL ((1, 2));
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -1,6 +1,5 @@
/* Get address information (partial implementation). /* Get address information (partial implementation).
Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Copyright (C) 1997, 2001-2002, 2004-2009 Free Software Foundation, Inc.
Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>. Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -19,6 +18,10 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the sa == NULL test below. */
#define _GL_ARG_NONNULL(params)
#include <netdb.h> #include <netdb.h>
#if HAVE_NETINET_IN_H #if HAVE_NETINET_IN_H

View File

@@ -21,6 +21,10 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below. */
#define _GL_ARG_NONNULL(params)
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <limits.h>

View File

@@ -121,6 +121,8 @@
# endif # endif
#endif #endif
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -222,17 +224,17 @@ struct option
the environment, then do not permute arguments. */ the environment, then do not permute arguments. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW; __THROW _GL_ARG_NONNULL ((2, 3));
#ifndef __need_getopt #ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts, const char *__shortopts,
const struct option *__longopts, int *__longind) const struct option *__longopts, int *__longind)
__THROW; __THROW _GL_ARG_NONNULL ((2, 3));
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts, const char *__shortopts,
const struct option *__longopts, int *__longind) const struct option *__longopts, int *__longind)
__THROW; __THROW _GL_ARG_NONNULL ((2, 3));
#endif #endif

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991,92,95-98,2000,2001,2004-2007 Free Software Foundation, Inc. /* Copyright (C) 1991,92,95-98,2000,2001,2004-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -173,10 +173,10 @@ typedef struct
#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined __GLOB_GNULIB #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined __GLOB_GNULIB
extern int glob (const char *_Restrict_ __pattern, int __flags, extern int glob (const char *_Restrict_ __pattern, int __flags,
int (*__errfunc) (const char *, int), int (*__errfunc) (const char *, int),
glob_t *_Restrict_ __pglob) __THROW; glob_t *_Restrict_ __pglob) __THROW _GL_ARG_NONNULL ((1, 4));
/* Free storage allocated in PGLOB by a previous `glob' call. */ /* Free storage allocated in PGLOB by a previous `glob' call. */
extern void globfree (glob_t *__pglob) __THROW; extern void globfree (glob_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
#else #else
extern int __REDIRECT_NTH (glob, (const char *_Restrict_ __pattern, extern int __REDIRECT_NTH (glob, (const char *_Restrict_ __pattern,
int __flags, int __flags,
@@ -189,9 +189,10 @@ extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
#if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB #if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
extern int glob64 (const char *_Restrict_ __pattern, int __flags, extern int glob64 (const char *_Restrict_ __pattern, int __flags,
int (*__errfunc) (const char *, int), int (*__errfunc) (const char *, int),
glob64_t *_Restrict_ __pglob) __THROW; glob64_t *_Restrict_ __pglob)
__THROW _GL_ARG_NONNULL ((1, 4));
extern void globfree64 (glob64_t *__pglob) __THROW; extern void globfree64 (glob64_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
#endif #endif
@@ -201,7 +202,8 @@ extern void globfree64 (glob64_t *__pglob) __THROW;
This function is not part of the interface specified by POSIX.2 This function is not part of the interface specified by POSIX.2
but several programs want to use it. */ but several programs want to use it. */
extern int glob_pattern_p (const char *__pattern, int __quote) __THROW; extern int glob_pattern_p (const char *__pattern, int __quote)
__THROW _GL_ARG_NONNULL ((1));
#endif #endif
__END_DECLS __END_DECLS

View File

@@ -19,6 +19,10 @@
# include <config.h> # include <config.h>
#endif #endif
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the pattern == NULL || pglob == NULL tests below. */
#define _GL_ARG_NONNULL(params)
#include <glob.h> #include <glob.h>
#include <errno.h> #include <errno.h>

View File

@@ -1,6 +1,6 @@
/* glob.h -- Find a path matching a pattern. /* glob.h -- Find a path matching a pattern.
Copyright (C) 2005-2007 Free Software Foundation, Inc. Copyright (C) 2005-2007, 2009 Free Software Foundation, Inc.
Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU> Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
@@ -40,6 +40,8 @@
# define __THROW # define __THROW
#endif #endif
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifndef __size_t #ifndef __size_t
# define __size_t size_t # define __size_t size_t
#endif #endif

View File

@@ -1,6 +1,6 @@
/* A GNU-like <iconv.h>. /* A GNU-like <iconv.h>.
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 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 it under the terms of the GNU General Public License as published by
@@ -28,6 +28,8 @@
#ifndef _GL_ICONV_H #ifndef _GL_ICONV_H
#define _GL_ICONV_H #define _GL_ICONV_H
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -37,7 +39,8 @@ extern "C" {
/* An iconv_open wrapper that supports the IANA standardized encoding names /* An iconv_open wrapper that supports the IANA standardized encoding names
("ISO-8859-1" etc.) as far as possible. */ ("ISO-8859-1" etc.) as far as possible. */
# define iconv_open rpl_iconv_open # define iconv_open rpl_iconv_open
extern iconv_t iconv_open (const char *tocode, const char *fromcode); extern iconv_t iconv_open (const char *tocode, const char *fromcode)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @REPLACE_ICONV_UTF@ #if @REPLACE_ICONV_UTF@

View File

@@ -47,6 +47,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* 7.8.1 Macros for format specifiers */ /* 7.8.1 Macros for format specifiers */
#if ! defined __cplusplus || defined __STDC_FORMAT_MACROS #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
@@ -1066,7 +1068,7 @@ extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
#if @GNULIB_STRTOIMAX@ #if @GNULIB_STRTOIMAX@
# if !@HAVE_DECL_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@
extern intmax_t strtoimax (const char *, char **, int); extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoimax # undef strtoimax
@@ -1078,7 +1080,7 @@ extern intmax_t strtoimax (const char *, char **, int);
#if @GNULIB_STRTOUMAX@ #if @GNULIB_STRTOUMAX@
# if !@HAVE_DECL_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@
extern uintmax_t strtoumax (const char *, char **, int); extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoumax # undef strtoumax

View File

@@ -34,6 +34,8 @@
# include <xlocale.h> # include <xlocale.h>
#endif #endif
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C. /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
On systems that don't define it, use the same value as GNU libintl. */ On systems that don't define it, use the same value as GNU libintl. */
#if !defined LC_MESSAGES #if !defined LC_MESSAGES
@@ -44,7 +46,7 @@
# if @REPLACE_DUPLOCALE@ # if @REPLACE_DUPLOCALE@
# undef duplocale # undef duplocale
# define duplocale rpl_duplocale # define duplocale rpl_duplocale
extern locale_t duplocale (locale_t locale); extern locale_t duplocale (locale_t locale) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef duplocale # undef duplocale

View File

@@ -30,6 +30,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -74,7 +76,7 @@ _NaN ()
#if @GNULIB_FREXP@ #if @GNULIB_FREXP@
# if @REPLACE_FREXP@ # if @REPLACE_FREXP@
# define frexp rpl_frexp # define frexp rpl_frexp
extern double frexp (double x, int *expptr); extern double frexp (double x, int *expptr) _GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef frexp # undef frexp
@@ -211,7 +213,7 @@ extern long double floorl (long double x);
# define frexpl rpl_frexpl # define frexpl rpl_frexpl
#endif #endif
#if (@GNULIB_FREXPL@ && @REPLACE_FREXPL@) || !@HAVE_DECL_FREXPL@ #if (@GNULIB_FREXPL@ && @REPLACE_FREXPL@) || !@HAVE_DECL_FREXPL@
extern long double frexpl (long double x, int *expptr); extern long double frexpl (long double x, int *expptr) _GL_ARG_NONNULL ((2));
#endif #endif
#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
# undef frexpl # undef frexpl

View File

@@ -1,5 +1,5 @@
/* Provide a netdb.h header file for systems lacking it (read: MinGW). /* Provide a netdb.h header file for systems lacking it (read: MinGW).
Copyright (C) 2008 Free Software Foundation, Inc. Copyright (C) 2008-2009 Free Software Foundation, Inc.
Written by Simon Josefsson. Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -39,6 +39,8 @@
/* Get netdb.h definitions such as struct hostent for MinGW. */ /* Get netdb.h definitions such as struct hostent for MinGW. */
#include <sys/socket.h> #include <sys/socket.h>
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Declarations for a platform that lacks <netdb.h>, or where it is /* Declarations for a platform that lacks <netdb.h>, or where it is
incomplete. */ incomplete. */
@@ -141,14 +143,15 @@ struct addrinfo
extern int getaddrinfo (const char *restrict nodename, extern int getaddrinfo (const char *restrict nodename,
const char *restrict servname, const char *restrict servname,
const struct addrinfo *restrict hints, const struct addrinfo *restrict hints,
struct addrinfo **restrict res); struct addrinfo **restrict res)
_GL_ARG_NONNULL ((4));
# endif # endif
# if !@HAVE_DECL_FREEADDRINFO@ # if !@HAVE_DECL_FREEADDRINFO@
/* Free `addrinfo' structure AI including associated storage. /* Free `addrinfo' structure AI including associated storage.
For more details, see the POSIX:2001 specification For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */ <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
extern void freeaddrinfo (struct addrinfo *ai); extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1));
# endif # endif
# if !@HAVE_DECL_GAI_STRERROR@ # if !@HAVE_DECL_GAI_STRERROR@
@@ -165,7 +168,8 @@ extern const char *gai_strerror (int ecode);
extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
char *restrict node, socklen_t nodelen, char *restrict node, socklen_t nodelen,
char *restrict service, socklen_t servicelen, char *restrict service, socklen_t servicelen,
int flags); int flags)
_GL_ARG_NONNULL ((1));
# endif # endif
/* Possible flags for getnameinfo. */ /* Possible flags for getnameinfo. */

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (C) 1995, 2005, 2008 Free Software Foundation, Inc. Copyright (C) 1995, 2005, 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -52,6 +52,11 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the buf == NULL, arg_state == NULL, result == NULL tests
below. */
#define _GL_ARG_NONNULL(params)
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -1,6 +1,6 @@
/* A GNU-like <search.h>. /* A GNU-like <search.h>.
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 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 it under the terms of the GNU General Public License as published by
@@ -31,6 +31,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -65,18 +67,21 @@ VISIT;
If one is found, it is returned. Otherwise, a new element equal to KEY If one is found, it is returned. Otherwise, a new element equal to KEY
is inserted in the tree and is returned. */ is inserted in the tree and is returned. */
extern void * tsearch (const void *key, void **vrootp, extern void * tsearch (const void *key, void **vrootp,
int (*compar) (const void *, const void *)); int (*compar) (const void *, const void *))
_GL_ARG_NONNULL ((1, 2, 3));
/* Searches an element in the tree *VROOTP that compares equal to KEY. /* Searches an element in the tree *VROOTP that compares equal to KEY.
If one is found, it is returned. Otherwise, NULL is returned. */ If one is found, it is returned. Otherwise, NULL is returned. */
extern void * tfind (const void *key, void *const *vrootp, extern void * tfind (const void *key, void *const *vrootp,
int (*compar) (const void *, const void *)); int (*compar) (const void *, const void *))
_GL_ARG_NONNULL ((1, 2, 3));
/* Searches an element in the tree *VROOTP that compares equal to KEY. /* Searches an element in the tree *VROOTP that compares equal to KEY.
If one is found, it is removed from the tree, and its parent node is If one is found, it is removed from the tree, and its parent node is
returned. Otherwise, NULL is returned. */ returned. Otherwise, NULL is returned. */
extern void * tdelete (const void *key, void **vrootp, extern void * tdelete (const void *key, void **vrootp,
int (*compar) (const void *, const void *)); int (*compar) (const void *, const void *))
_GL_ARG_NONNULL ((1, 2, 3));
/* Perform a depth-first, left-to-right traversal of the tree VROOT. /* Perform a depth-first, left-to-right traversal of the tree VROOT.
The ACTION function is called: The ACTION function is called:
@@ -90,7 +95,8 @@ extern void * tdelete (const void *key, void **vrootp,
2. an indicator which visit of the node this is, 2. an indicator which visit of the node this is,
3. the level of the node in the tree (0 for the root). */ 3. the level of the node in the tree (0 for the root). */
extern void twalk (const void *vroot, extern void twalk (const void *vroot,
void (*action) (const void *, VISIT, int)); void (*action) (const void *, VISIT, int))
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK

View File

@@ -17,6 +17,11 @@
#if !_LIBC #if !_LIBC
# include <config.h> # include <config.h>
#endif #endif
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the name == NULL test below. */
#define _GL_ARG_NONNULL(params)
#include <alloca.h> #include <alloca.h>
/* Specification. */ /* Specification. */

View File

@@ -37,6 +37,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Define pid_t, uid_t. /* Define pid_t, uid_t.
Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
#include <sys/types.h> #include <sys/types.h>
@@ -82,22 +84,22 @@ typedef unsigned int sigset_t;
# endif # endif
/* Test whether a given signal is contained in a signal set. */ /* Test whether a given signal is contained in a signal set. */
extern int sigismember (const sigset_t *set, int sig); extern int sigismember (const sigset_t *set, int sig) _GL_ARG_NONNULL ((1));
/* Initialize a signal set to the empty set. */ /* Initialize a signal set to the empty set. */
extern int sigemptyset (sigset_t *set); extern int sigemptyset (sigset_t *set) _GL_ARG_NONNULL ((1));
/* Add a signal to a signal set. */ /* Add a signal to a signal set. */
extern int sigaddset (sigset_t *set, int sig); extern int sigaddset (sigset_t *set, int sig) _GL_ARG_NONNULL ((1));
/* Remove a signal from a signal set. */ /* Remove a signal from a signal set. */
extern int sigdelset (sigset_t *set, int sig); extern int sigdelset (sigset_t *set, int sig) _GL_ARG_NONNULL ((1));
/* Fill a signal set with all possible signals. */ /* Fill a signal set with all possible signals. */
extern int sigfillset (sigset_t *set); extern int sigfillset (sigset_t *set) _GL_ARG_NONNULL ((1));
/* Return the set of those blocked signals that are pending. */ /* Return the set of those blocked signals that are pending. */
extern int sigpending (sigset_t *set); extern int sigpending (sigset_t *set) _GL_ARG_NONNULL ((1));
/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET. /* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
Then, if SET is not NULL, affect the current set of blocked signals by Then, if SET is not NULL, affect the current set of blocked signals by

View File

@@ -1,5 +1,5 @@
/* Definitions for POSIX spawn interface. /* Definitions for POSIX spawn interface.
Copyright (C) 2000, 2003, 2004, 2008 Free Software Foundation, Inc. Copyright (C) 2000, 2003, 2004, 2008-2009 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -67,6 +67,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Data structure to contain attributes for thread creation. */ /* Data structure to contain attributes for thread creation. */
#if @REPLACE_POSIX_SPAWN@ #if @REPLACE_POSIX_SPAWN@
@@ -147,7 +149,8 @@ extern int posix_spawn (pid_t *_Restrict_ __pid,
const posix_spawn_file_actions_t *_Restrict_ __file_actions, const posix_spawn_file_actions_t *_Restrict_ __file_actions,
const posix_spawnattr_t *_Restrict_ __attrp, const posix_spawnattr_t *_Restrict_ __attrp,
char *const argv[_Restrict_arr_], char *const argv[_Restrict_arr_],
char *const envp[_Restrict_arr_]); char *const envp[_Restrict_arr_])
_GL_ARG_NONNULL ((2, 5, 6));
# endif # endif
#endif #endif
@@ -163,7 +166,8 @@ extern int posix_spawn (pid_t *_Restrict_ __pid,
extern int posix_spawnp (pid_t *__pid, const char *__file, extern int posix_spawnp (pid_t *__pid, const char *__file,
const posix_spawn_file_actions_t *__file_actions, const posix_spawn_file_actions_t *__file_actions,
const posix_spawnattr_t *__attrp, const posix_spawnattr_t *__attrp,
char *const argv[], char *const envp[]); char *const argv[], char *const envp[])
_GL_ARG_NONNULL ((2, 5, 6));
# endif # endif
#endif #endif
@@ -174,7 +178,8 @@ extern int posix_spawnp (pid_t *__pid, const char *__file,
# define posix_spawnattr_init rpl_posix_spawnattr_init # define posix_spawnattr_init rpl_posix_spawnattr_init
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW; extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -184,7 +189,8 @@ extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
# define posix_spawnattr_destroy rpl_posix_spawnattr_destroy # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW; extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -197,7 +203,7 @@ extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
sigset_t *_Restrict_ __sigdefault) sigset_t *_Restrict_ __sigdefault)
__THROW; __THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -209,7 +215,7 @@ extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
const sigset_t *_Restrict_ __sigdefault) const sigset_t *_Restrict_ __sigdefault)
__THROW; __THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -220,7 +226,8 @@ extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
sigset_t *_Restrict_ __sigmask) __THROW; sigset_t *_Restrict_ __sigmask)
__THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -232,7 +239,7 @@ extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __att
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
const sigset_t *_Restrict_ __sigmask) const sigset_t *_Restrict_ __sigmask)
__THROW; __THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -243,7 +250,8 @@ extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
short int *_Restrict_ __flags) __THROW; short int *_Restrict_ __flags)
__THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -254,7 +262,8 @@ extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr, extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
short int __flags) __THROW; short int __flags)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -266,7 +275,7 @@ extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
pid_t *_Restrict_ __pgroup) pid_t *_Restrict_ __pgroup)
__THROW; __THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -277,7 +286,8 @@ extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr, extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
pid_t __pgroup) __THROW; pid_t __pgroup)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -289,7 +299,7 @@ extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
int *_Restrict_ __schedpolicy) int *_Restrict_ __schedpolicy)
__THROW; __THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -300,7 +310,8 @@ extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ _
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr, extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
int __schedpolicy) __THROW; int __schedpolicy)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -311,7 +322,8 @@ extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
struct sched_param *_Restrict_ __schedparam) __THROW; struct sched_param *_Restrict_ __schedparam)
__THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -322,7 +334,8 @@ extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr, extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
const struct sched_param *_Restrict_ __schedparam) __THROW; const struct sched_param *_Restrict_ __schedparam)
__THROW _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -333,7 +346,8 @@ extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
# define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions) __THROW; extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -343,7 +357,8 @@ extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_act
# define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions) __THROW; extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -358,7 +373,7 @@ extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restri
int __fd, int __fd,
const char *_Restrict_ __path, const char *_Restrict_ __path,
int __oflag, mode_t __mode) int __oflag, mode_t __mode)
__THROW; __THROW _GL_ARG_NONNULL ((1, 3));
# endif # endif
#endif #endif
@@ -371,7 +386,7 @@ extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restri
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions, extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
int __fd) int __fd)
__THROW; __THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -383,7 +398,8 @@ extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file
# endif # endif
# if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions, extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
int __fd, int __newfd) __THROW; int __fd, int __newfd)
__THROW _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif

View File

@@ -63,6 +63,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -74,7 +76,7 @@ extern "C" {
# endif # endif
# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ # if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
extern int dprintf (int fd, const char *format, ...) extern int dprintf (int fd, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef dprintf # undef dprintf
@@ -88,7 +90,7 @@ extern int dprintf (int fd, const char *format, ...)
# if @REPLACE_FCLOSE@ # if @REPLACE_FCLOSE@
# define fclose rpl_fclose # define fclose rpl_fclose
/* Close STREAM and its underlying file descriptor. */ /* Close STREAM and its underlying file descriptor. */
extern int fclose (FILE *stream); extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fclose # undef fclose
@@ -123,7 +125,8 @@ extern int fclose (FILE *stream);
# if @REPLACE_FOPEN@ # if @REPLACE_FOPEN@
# undef fopen # undef fopen
# define fopen rpl_fopen # define fopen rpl_fopen
extern FILE * fopen (const char *filename, const char *mode); extern FILE * fopen (const char *filename, const char *mode)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fopen # undef fopen
@@ -137,12 +140,14 @@ extern FILE * fopen (const char *filename, const char *mode);
# if @REPLACE_FPRINTF@ # if @REPLACE_FPRINTF@
# define fprintf rpl_fprintf # define fprintf rpl_fprintf
extern int fprintf (FILE *fp, const char *format, ...) extern int fprintf (FILE *fp, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3)))
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define fprintf rpl_fprintf # define fprintf rpl_fprintf
extern int fprintf (FILE *fp, const char *format, ...) extern int fprintf (FILE *fp, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3)))
_GL_ARG_NONNULL ((1, 2));
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fprintf # undef fprintf
# define fprintf \ # define fprintf \
@@ -163,7 +168,7 @@ extern int fprintf (FILE *fp, const char *format, ...)
was before the write calls. When discarding pending input, the file was before the write calls. When discarding pending input, the file
position is advanced to match the end of the previously read input. position is advanced to match the end of the previously read input.
Return 0 if successful. Upon error, return -1 and set errno. */ Return 0 if successful. Upon error, return -1 and set errno. */
extern int fpurge (FILE *gl_stream); extern int fpurge (FILE *gl_stream) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fpurge # undef fpurge
@@ -176,20 +181,21 @@ extern int fprintf (FILE *fp, const char *format, ...)
#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputc # undef fputc
# define fputc rpl_fputc # define fputc rpl_fputc
extern int fputc (int c, FILE *stream); extern int fputc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
#endif #endif
#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fputs # undef fputs
# define fputs rpl_fputs # define fputs rpl_fputs
extern int fputs (const char *string, FILE *stream); extern int fputs (const char *string, FILE *stream) _GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_FREOPEN@ #if @GNULIB_FREOPEN@
# if @REPLACE_FREOPEN@ # if @REPLACE_FREOPEN@
# undef freopen # undef freopen
# define freopen rpl_freopen # define freopen rpl_freopen
extern FILE * freopen (const char *filename, const char *mode, FILE *stream); extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef freopen # undef freopen
@@ -200,7 +206,7 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
#endif #endif
#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@ #if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
extern int rpl_fseek (FILE *fp, long offset, int whence); extern int rpl_fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
# undef fseek # undef fseek
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
# define fseek(f,o,w) \ # define fseek(f,o,w) \
@@ -226,7 +232,7 @@ extern int rpl_fseek (FILE *fp, long offset, int whence);
/* Provide fseek, fseeko functions that are aware of a preceding /* Provide fseek, fseeko functions that are aware of a preceding
fflush(), and which detect pipes. */ fflush(), and which detect pipes. */
# define fseeko rpl_fseeko # define fseeko rpl_fseeko
extern int fseeko (FILE *fp, off_t offset, int whence); extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1));
# if !@GNULIB_FSEEK@ # if !@GNULIB_FSEEK@
# undef fseek # undef fseek
# define fseek(f,o,w) \ # define fseek(f,o,w) \
@@ -245,7 +251,7 @@ extern int fseeko (FILE *fp, off_t offset, int whence);
#endif #endif
#if @GNULIB_FTELL@ && @REPLACE_FTELL@ #if @GNULIB_FTELL@ && @REPLACE_FTELL@
extern long rpl_ftell (FILE *fp); extern long rpl_ftell (FILE *fp) _GL_ARG_NONNULL ((1));
# undef ftell # undef ftell
# if GNULIB_POSIXCHECK # if GNULIB_POSIXCHECK
# define ftell(f) \ # define ftell(f) \
@@ -269,7 +275,7 @@ extern long rpl_ftell (FILE *fp);
#if @GNULIB_FTELLO@ #if @GNULIB_FTELLO@
# if @REPLACE_FTELLO@ # if @REPLACE_FTELLO@
# define ftello rpl_ftello # define ftello rpl_ftello
extern off_t ftello (FILE *fp); extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1));
# if !@GNULIB_FTELL@ # if !@GNULIB_FTELL@
# undef ftell # undef ftell
# define ftell(f) \ # define ftell(f) \
@@ -290,7 +296,8 @@ extern off_t ftello (FILE *fp);
#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef fwrite # undef fwrite
# define fwrite rpl_fwrite # define fwrite rpl_fwrite
extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream); extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
_GL_ARG_NONNULL ((1, 4));
#endif #endif
#if @GNULIB_GETDELIM@ #if @GNULIB_GETDELIM@
@@ -302,7 +309,8 @@ extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
Return the number of bytes read and stored at *LINEPTR (not including the Return the number of bytes read and stored at *LINEPTR (not including the
NUL terminator), or -1 on error or EOF. */ NUL terminator), or -1 on error or EOF. */
extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
FILE *stream); FILE *stream)
_GL_ARG_NONNULL ((1, 2, 4));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getdelim # undef getdelim
@@ -324,7 +332,8 @@ extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
bytes of space. It is realloc'd as necessary. bytes of space. It is realloc'd as necessary.
Return the number of bytes read and stored at *LINEPTR (not including the Return the number of bytes read and stored at *LINEPTR (not including the
NUL terminator), or -1 on error or EOF. */ NUL terminator), or -1 on error or EOF. */
extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream)
_GL_ARG_NONNULL ((1, 2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getline # undef getline
@@ -347,10 +356,10 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
memory allocation error, call obstack_alloc_failed_handler. Upon memory allocation error, call obstack_alloc_failed_handler. Upon
other error, return -1. */ other error, return -1. */
extern int obstack_printf (struct obstack *obs, const char *format, ...) extern int obstack_printf (struct obstack *obs, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
extern int obstack_vprintf (struct obstack *obs, const char *format, extern int obstack_vprintf (struct obstack *obs, const char *format,
va_list args) va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -374,7 +383,8 @@ extern void perror (const char *string);
# if @REPLACE_POPEN@ # if @REPLACE_POPEN@
# undef popen # undef popen
# define popen rpl_popen # define popen rpl_popen
extern FILE *popen (const char *cmd, const char *mode); extern FILE *popen (const char *cmd, const char *mode)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef popen # undef popen
@@ -389,13 +399,13 @@ extern FILE *popen (const char *cmd, const char *mode);
/* Don't break __attribute__((format(printf,M,N))). */ /* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__ # define printf __printf__
extern int printf (const char *format, ...) extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2))); __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
# endif # endif
#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
/* Don't break __attribute__((format(printf,M,N))). */ /* Don't break __attribute__((format(printf,M,N))). */
# define printf __printf__ # define printf __printf__
extern int printf (const char *format, ...) extern int printf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2))); __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef printf # undef printf
# define printf \ # define printf \
@@ -415,7 +425,7 @@ extern int printf (const char *format, ...)
#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef putc # undef putc
# define putc rpl_fputc # define putc rpl_fputc
extern int putc (int c, FILE *stream); extern int putc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
#endif #endif
#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@@ -427,14 +437,14 @@ extern int putchar (int c);
#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# undef puts # undef puts
# define puts rpl_puts # define puts rpl_puts
extern int puts (const char *string); extern int puts (const char *string) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_REMOVE@ #if @GNULIB_REMOVE@
# if @REPLACE_REMOVE@ # if @REPLACE_REMOVE@
# undef remove # undef remove
# define remove rpl_remove # define remove rpl_remove
extern int remove (const char *name); extern int remove (const char *name) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef remove # undef remove
@@ -448,7 +458,8 @@ extern int remove (const char *name);
# if @REPLACE_RENAME@ # if @REPLACE_RENAME@
# undef rename # undef rename
# define rename rpl_rename # define rename rpl_rename
extern int rename (const char *old_filename, const char *new_filename); extern int rename (const char *old_filename, const char *new_filename)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rename # undef rename
@@ -464,7 +475,8 @@ extern int rename (const char *old_filename, const char *new_filename);
# define renameat rpl_renameat # define renameat rpl_renameat
# endif # endif
# if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@ # if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@
extern int renameat (int fd1, char const *file1, int fd2, char const *file2); extern int renameat (int fd1, char const *file1, int fd2, char const *file2)
_GL_ARG_NONNULL ((2, 4));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef renameat # undef renameat
@@ -480,7 +492,8 @@ extern int renameat (int fd1, char const *file1, int fd2, char const *file2);
# endif # endif
# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
extern int snprintf (char *str, size_t size, const char *format, ...) extern int snprintf (char *str, size_t size, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4))); __attribute__ ((__format__ (__printf__, 3, 4)))
_GL_ARG_NONNULL ((3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef snprintf # undef snprintf
@@ -494,7 +507,8 @@ extern int snprintf (char *str, size_t size, const char *format, ...)
# if @REPLACE_SPRINTF@ # if @REPLACE_SPRINTF@
# define sprintf rpl_sprintf # define sprintf rpl_sprintf
extern int sprintf (char *str, const char *format, ...) extern int sprintf (char *str, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3)))
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef sprintf # undef sprintf
@@ -516,9 +530,9 @@ extern int sprintf (char *str, const char *format, ...)
*RESULT and return the number of resulting bytes, excluding the trailing *RESULT and return the number of resulting bytes, excluding the trailing
NUL. Upon memory allocation error, or some other error, return -1. */ NUL. Upon memory allocation error, or some other error, return -1. */
extern int asprintf (char **result, const char *format, ...) extern int asprintf (char **result, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
extern int vasprintf (char **result, const char *format, va_list args) extern int vasprintf (char **result, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#endif #endif
@@ -528,7 +542,7 @@ extern int sprintf (char *str, const char *format, ...)
# endif # endif
# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ # if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
extern int vdprintf (int fd, const char *format, va_list args) extern int vdprintf (int fd, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef vdprintf # undef vdprintf
@@ -542,12 +556,14 @@ extern int vdprintf (int fd, const char *format, va_list args)
# if @REPLACE_VFPRINTF@ # if @REPLACE_VFPRINTF@
# define vfprintf rpl_vfprintf # define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args) extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0)))
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vfprintf rpl_vfprintf # define vfprintf rpl_vfprintf
extern int vfprintf (FILE *fp, const char *format, va_list args) extern int vfprintf (FILE *fp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0)))
_GL_ARG_NONNULL ((1, 2));
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef vfprintf # undef vfprintf
# define vfprintf(s,f,a) \ # define vfprintf(s,f,a) \
@@ -561,12 +577,12 @@ extern int vfprintf (FILE *fp, const char *format, va_list args)
# if @REPLACE_VPRINTF@ # if @REPLACE_VPRINTF@
# define vprintf rpl_vprintf # define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args) extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0))); __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
# endif # endif
#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ #elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
# define vprintf rpl_vprintf # define vprintf rpl_vprintf
extern int vprintf (const char *format, va_list args) extern int vprintf (const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 1, 0))); __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef vprintf # undef vprintf
# define vprintf(f,a) \ # define vprintf(f,a) \
@@ -582,7 +598,8 @@ extern int vprintf (const char *format, va_list args)
# endif # endif
# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
extern int vsnprintf (char *str, size_t size, const char *format, va_list args) extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 3, 0))); __attribute__ ((__format__ (__printf__, 3, 0)))
_GL_ARG_NONNULL ((3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef vsnprintf # undef vsnprintf
@@ -596,7 +613,8 @@ extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
# if @REPLACE_VSPRINTF@ # if @REPLACE_VSPRINTF@
# define vsprintf rpl_vsprintf # define vsprintf rpl_vsprintf
extern int vsprintf (char *str, const char *format, va_list args) extern int vsprintf (char *str, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0))); __attribute__ ((__format__ (__printf__, 2, 0)))
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef vsprintf # undef vsprintf

View File

@@ -68,6 +68,8 @@ struct random_data
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
#ifndef EXIT_SUCCESS #ifndef EXIT_SUCCESS
@@ -91,7 +93,7 @@ extern "C" {
# if !@HAVE_ATOLL@ # if !@HAVE_ATOLL@
/* Parse a signed decimal integer. /* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */ Returns the value of the integer. Errors are not detected. */
extern long long atoll (const char *string); extern long long atoll (const char *string) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef atoll # undef atoll
@@ -120,7 +122,7 @@ extern void * calloc (size_t nmemb, size_t size);
# define canonicalize_file_name rpl_canonicalize_file_name # define canonicalize_file_name rpl_canonicalize_file_name
# endif # endif
# if !@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@ # if !@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@
extern char *canonicalize_file_name (const char *name); extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef canonicalize_file_name # undef canonicalize_file_name
@@ -136,7 +138,7 @@ extern char *canonicalize_file_name (const char *name);
The three numbers are the load average of the last 1 minute, the last 5 The three numbers are the load average of the last 1 minute, the last 5
minutes, and the last 15 minutes, respectively. minutes, and the last 15 minutes, respectively.
LOADAVG is an array of NELEM numbers. */ LOADAVG is an array of NELEM numbers. */
extern int getloadavg (double loadavg[], int nelem); extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getloadavg # undef getloadavg
@@ -159,7 +161,8 @@ extern int getloadavg (double loadavg[], int nelem);
For more details see the POSIX:2001 specification. For more details see the POSIX:2001 specification.
http://www.opengroup.org/susv3xsh/getsubopt.html */ http://www.opengroup.org/susv3xsh/getsubopt.html */
# if !@HAVE_GETSUBOPT@ # if !@HAVE_GETSUBOPT@
extern int getsubopt (char **optionp, char *const *tokens, char **valuep); extern int getsubopt (char **optionp, char *const *tokens, char **valuep)
_GL_ARG_NONNULL ((1, 2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getsubopt # undef getsubopt
@@ -190,7 +193,7 @@ extern void * malloc (size_t size);
they are replaced with a string that makes the directory name unique. they are replaced with a string that makes the directory name unique.
Returns TEMPLATE, or a null pointer if it cannot get a unique name. Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */ The directory is created mode 700. */
extern char * mkdtemp (char * /*template*/); extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkdtemp # undef mkdtemp
@@ -214,7 +217,7 @@ extern char * mkdtemp (char * /*template*/);
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkostemp (char * /*template*/, int /*flags*/); extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkostemp # undef mkostemp
@@ -239,7 +242,8 @@ extern int mkostemp (char * /*template*/, int /*flags*/);
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/); extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkostemps # undef mkostemps
@@ -261,7 +265,7 @@ extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/);
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
# define mkstemp rpl_mkstemp # define mkstemp rpl_mkstemp
extern int mkstemp (char * /*template*/); extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1));
# else # else
/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */ /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
# include <unistd.h> # include <unistd.h>
@@ -286,7 +290,8 @@ extern int mkstemp (char * /*template*/);
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkstemps (char * /*template*/, int /*suffixlen*/); extern int mkstemps (char * /*template*/, int /*suffixlen*/)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkstemps # undef mkstemps
@@ -300,7 +305,7 @@ extern int mkstemps (char * /*template*/, int /*suffixlen*/);
# if @REPLACE_PUTENV@ # if @REPLACE_PUTENV@
# undef putenv # undef putenv
# define putenv rpl_putenv # define putenv rpl_putenv
extern int putenv (char *string); extern int putenv (char *string) _GL_ARG_NONNULL ((1));
# endif # endif
#endif #endif
@@ -311,11 +316,15 @@ extern int putenv (char *string);
# define RAND_MAX 2147483647 # define RAND_MAX 2147483647
# endif # endif
int srandom_r (unsigned int seed, struct random_data *rand_state); int srandom_r (unsigned int seed, struct random_data *rand_state)
_GL_ARG_NONNULL ((2));
int initstate_r (unsigned int seed, char *buf, size_t buf_size, int initstate_r (unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state); struct random_data *rand_state)
int setstate_r (char *arg_state, struct random_data *rand_state); _GL_ARG_NONNULL ((2, 4));
int random_r (struct random_data *buf, int32_t *result); int setstate_r (char *arg_state, struct random_data *rand_state)
_GL_ARG_NONNULL ((1, 2));
int random_r (struct random_data *buf, int32_t *result)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef random_r # undef random_r
@@ -359,7 +368,7 @@ extern void * realloc (void *ptr, size_t size);
# define realpath rpl_realpath # define realpath rpl_realpath
# endif # endif
# if !@HAVE_REALPATH@ || @REPLACE_REALPATH@ # if !@HAVE_REALPATH@ || @REPLACE_REALPATH@
extern char *realpath (const char *name, char *resolved); extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef realpath # undef realpath
@@ -373,7 +382,7 @@ extern char *realpath (const char *name, char *resolved);
# if !@HAVE_RPMATCH@ # if !@HAVE_RPMATCH@
/* Test a user response to a question. /* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
extern int rpmatch (const char *response); extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rpmatch # undef rpmatch
@@ -391,7 +400,8 @@ extern int rpmatch (const char *response);
# if !@HAVE_SETENV@ || @REPLACE_SETENV@ # if !@HAVE_SETENV@ || @REPLACE_SETENV@
/* Set NAME to VALUE in the environment. /* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */ If REPLACE is nonzero, overwrite an existing value. */
extern int setenv (const char *name, const char *value, int replace); extern int setenv (const char *name, const char *value, int replace)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef setenv # undef setenv
@@ -407,7 +417,7 @@ extern int setenv (const char *name, const char *value, int replace);
# endif # endif
# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */ /* Parse a double from STRING, updating ENDP if appropriate. */
extern double strtod (const char *str, char **endp); extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtod # undef strtod
@@ -427,7 +437,8 @@ extern double strtod (const char *str, char **endp);
stored in *ENDPTR. stored in *ENDPTR.
Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
to ERANGE. */ to ERANGE. */
extern long long strtoll (const char *string, char **endptr, int base); extern long long strtoll (const char *string, char **endptr, int base)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoll # undef strtoll
@@ -447,7 +458,8 @@ extern long long strtoll (const char *string, char **endptr, int base);
stored in *ENDPTR. stored in *ENDPTR.
Upon overflow, the return value is ULLONG_MAX, and errno is set to Upon overflow, the return value is ULLONG_MAX, and errno is set to
ERANGE. */ ERANGE. */
extern unsigned long long strtoull (const char *string, char **endptr, int base); extern unsigned long long strtoull (const char *string, char **endptr, int base)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoull # undef strtoull
@@ -464,7 +476,7 @@ extern unsigned long long strtoull (const char *string, char **endptr, int base)
# endif # endif
# if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@ # if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@
/* Remove the variable NAME from the environment. */ /* Remove the variable NAME from the environment. */
extern int unsetenv (const char *name); extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef unsetenv # undef unsetenv

View File

@@ -45,6 +45,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -56,7 +58,7 @@ extern "C" {
# if @REPLACE_MEMCHR@ # if @REPLACE_MEMCHR@
# define memchr rpl_memchr # define memchr rpl_memchr
extern void *memchr (void const *__s, int __c, size_t __n) extern void *memchr (void const *__s, int __c, size_t __n)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memchr # undef memchr
@@ -74,7 +76,7 @@ extern void *memchr (void const *__s, int __c, size_t __n)
# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@ # if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
extern void *memmem (void const *__haystack, size_t __haystack_len, extern void *memmem (void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len) void const *__needle, size_t __needle_len)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memmem # undef memmem
@@ -90,7 +92,8 @@ extern void *memmem (void const *__haystack, size_t __haystack_len,
#if @GNULIB_MEMPCPY@ #if @GNULIB_MEMPCPY@
# if ! @HAVE_MEMPCPY@ # if ! @HAVE_MEMPCPY@
extern void *mempcpy (void *restrict __dest, void const *restrict __src, extern void *mempcpy (void *restrict __dest, void const *restrict __src,
size_t __n); size_t __n)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mempcpy # undef mempcpy
@@ -104,7 +107,7 @@ extern void *mempcpy (void *restrict __dest, void const *restrict __src,
#if @GNULIB_MEMRCHR@ #if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@ # if ! @HAVE_DECL_MEMRCHR@
extern void *memrchr (void const *, int, size_t) extern void *memrchr (void const *, int, size_t)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memrchr # undef memrchr
@@ -120,7 +123,7 @@ extern void *memrchr (void const *, int, size_t)
#if @GNULIB_RAWMEMCHR@ #if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@ # if ! @HAVE_RAWMEMCHR@
extern void *rawmemchr (void const *__s, int __c_in) extern void *rawmemchr (void const *__s, int __c_in)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rawmemchr # undef rawmemchr
@@ -133,7 +136,8 @@ extern void *rawmemchr (void const *__s, int __c_in)
/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
#if @GNULIB_STPCPY@ #if @GNULIB_STPCPY@
# if ! @HAVE_STPCPY@ # if ! @HAVE_STPCPY@
extern char *stpcpy (char *restrict __dst, char const *restrict __src); extern char *stpcpy (char *restrict __dst, char const *restrict __src)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stpcpy # undef stpcpy
@@ -149,7 +153,8 @@ extern char *stpcpy (char *restrict __dst, char const *restrict __src);
# if ! @HAVE_STPNCPY@ # if ! @HAVE_STPNCPY@
# define stpncpy gnu_stpncpy # define stpncpy gnu_stpncpy
extern char *stpncpy (char *restrict __dst, char const *restrict __src, extern char *stpncpy (char *restrict __dst, char const *restrict __src,
size_t __n); size_t __n)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stpncpy # undef stpncpy
@@ -174,7 +179,7 @@ extern char *stpncpy (char *restrict __dst, char const *restrict __src,
#if @GNULIB_STRCHRNUL@ #if @GNULIB_STRCHRNUL@
# if ! @HAVE_STRCHRNUL@ # if ! @HAVE_STRCHRNUL@
extern char *strchrnul (char const *__s, int __c_in) extern char *strchrnul (char const *__s, int __c_in)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strchrnul # undef strchrnul
@@ -191,7 +196,7 @@ extern char *strchrnul (char const *__s, int __c_in)
# define strdup rpl_strdup # define strdup rpl_strdup
# endif # endif
# if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@ # if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@
extern char *strdup (char const *__s); extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strdup # undef strdup
@@ -208,7 +213,7 @@ extern char *strdup (char const *__s);
# define strndup rpl_strndup # define strndup rpl_strndup
# endif # endif
# if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ # if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
extern char *strndup (char const *__string, size_t __n); extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strndup # undef strndup
@@ -224,7 +229,7 @@ extern char *strndup (char const *__string, size_t __n);
#if @GNULIB_STRNLEN@ #if @GNULIB_STRNLEN@
# if ! @HAVE_DECL_STRNLEN@ # if ! @HAVE_DECL_STRNLEN@
extern size_t strnlen (char const *__string, size_t __maxlen) extern size_t strnlen (char const *__string, size_t __maxlen)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strnlen # undef strnlen
@@ -251,7 +256,7 @@ extern size_t strnlen (char const *__string, size_t __maxlen)
#if @GNULIB_STRPBRK@ #if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@ # if ! @HAVE_STRPBRK@
extern char *strpbrk (char const *__s, char const *__accept) extern char *strpbrk (char const *__s, char const *__accept)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
/* strpbrk() assumes the second argument is a list of single-byte characters. /* strpbrk() assumes the second argument is a list of single-byte characters.
@@ -313,7 +318,8 @@ extern char *strpbrk (char const *__s, char const *__accept)
See also strtok_r(). */ See also strtok_r(). */
#if @GNULIB_STRSEP@ #if @GNULIB_STRSEP@
# if ! @HAVE_STRSEP@ # if ! @HAVE_STRSEP@
extern char *strsep (char **restrict __stringp, char const *restrict __delim); extern char *strsep (char **restrict __stringp, char const *restrict __delim)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
# undef strsep # undef strsep
@@ -334,8 +340,8 @@ extern char *strsep (char **restrict __stringp, char const *restrict __delim);
#if @GNULIB_STRSTR@ #if @GNULIB_STRSTR@
# if @REPLACE_STRSTR@ # if @REPLACE_STRSTR@
# define strstr rpl_strstr # define strstr rpl_strstr
char *strstr (const char *haystack, const char *needle) extern char *strstr (const char *haystack, const char *needle)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
/* strstr() does not work with multibyte strings if the locale encoding is /* strstr() does not work with multibyte strings if the locale encoding is
@@ -360,7 +366,7 @@ char *strstr (const char *haystack, const char *needle)
# endif # endif
# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@ # if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
extern char *strcasestr (const char *haystack, const char *needle) extern char *strcasestr (const char *haystack, const char *needle)
__attribute__ ((__pure__)); __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
/* strcasestr() does not work with multibyte strings: /* strcasestr() does not work with multibyte strings:
@@ -407,7 +413,8 @@ extern char *strcasestr (const char *haystack, const char *needle)
# endif # endif
# if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@ # if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
extern char *strtok_r (char *restrict s, char const *restrict delim, extern char *strtok_r (char *restrict s, char const *restrict delim,
char **restrict save_ptr); char **restrict save_ptr)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
# undef strtok_r # undef strtok_r
@@ -432,13 +439,13 @@ extern char *strtok_r (char *restrict s, char const *restrict delim,
#if @GNULIB_MBSLEN@ #if @GNULIB_MBSLEN@
/* Return the number of multibyte characters in the character string STRING. /* Return the number of multibyte characters in the character string STRING.
This considers multibyte characters, unlike strlen, which counts bytes. */ This considers multibyte characters, unlike strlen, which counts bytes. */
extern size_t mbslen (const char *string); extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_MBSNLEN@ #if @GNULIB_MBSNLEN@
/* Return the number of multibyte characters in the character string starting /* Return the number of multibyte characters in the character string starting
at STRING and ending at STRING + LEN. */ at STRING and ending at STRING + LEN. */
extern size_t mbsnlen (const char *string, size_t len); extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_MBSCHR@ #if @GNULIB_MBSCHR@
@@ -447,7 +454,7 @@ extern size_t mbsnlen (const char *string, size_t len);
Unlike strchr(), this function works correctly in multibyte locales with Unlike strchr(), this function works correctly in multibyte locales with
encodings such as GB18030. */ encodings such as GB18030. */
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ # define mbschr rpl_mbschr /* avoid collision with HP-UX function */
extern char * mbschr (const char *string, int c); extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_MBSRCHR@ #if @GNULIB_MBSRCHR@
@@ -456,7 +463,7 @@ extern char * mbschr (const char *string, int c);
Unlike strrchr(), this function works correctly in multibyte locales with Unlike strrchr(), this function works correctly in multibyte locales with
encodings such as GB18030. */ encodings such as GB18030. */
# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ # define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
extern char * mbsrchr (const char *string, int c); extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_MBSSTR@ #if @GNULIB_MBSSTR@
@@ -464,7 +471,8 @@ extern char * mbsrchr (const char *string, int c);
string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
Unlike strstr(), this function works correctly in multibyte locales with Unlike strstr(), this function works correctly in multibyte locales with
encodings different from UTF-8. */ encodings different from UTF-8. */
extern char * mbsstr (const char *haystack, const char *needle); extern char * mbsstr (const char *haystack, const char *needle)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSCASECMP@ #if @GNULIB_MBSCASECMP@
@@ -474,7 +482,8 @@ extern char * mbsstr (const char *haystack, const char *needle);
Note: This function may, in multibyte locales, return 0 for strings of Note: This function may, in multibyte locales, return 0 for strings of
different lengths! different lengths!
Unlike strcasecmp(), this function works correctly in multibyte locales. */ Unlike strcasecmp(), this function works correctly in multibyte locales. */
extern int mbscasecmp (const char *s1, const char *s2); extern int mbscasecmp (const char *s1, const char *s2)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSNCASECMP@ #if @GNULIB_MBSNCASECMP@
@@ -487,7 +496,8 @@ extern int mbscasecmp (const char *s1, const char *s2);
of different lengths! of different lengths!
Unlike strncasecmp(), this function works correctly in multibyte locales. Unlike strncasecmp(), this function works correctly in multibyte locales.
But beware that N is not a byte count but a character count! */ But beware that N is not a byte count but a character count! */
extern int mbsncasecmp (const char *s1, const char *s2, size_t n); extern int mbsncasecmp (const char *s1, const char *s2, size_t n)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSPCASECMP@ #if @GNULIB_MBSPCASECMP@
@@ -500,7 +510,8 @@ extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
smaller length than PREFIX! smaller length than PREFIX!
Unlike strncasecmp(), this function works correctly in multibyte Unlike strncasecmp(), this function works correctly in multibyte
locales. */ locales. */
extern char * mbspcasecmp (const char *string, const char *prefix); extern char * mbspcasecmp (const char *string, const char *prefix)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSCASESTR@ #if @GNULIB_MBSCASESTR@
@@ -509,7 +520,8 @@ extern char * mbspcasecmp (const char *string, const char *prefix);
Note: This function may, in multibyte locales, return success even if Note: This function may, in multibyte locales, return success even if
strlen (haystack) < strlen (needle) ! strlen (haystack) < strlen (needle) !
Unlike strcasestr(), this function works correctly in multibyte locales. */ Unlike strcasestr(), this function works correctly in multibyte locales. */
extern char * mbscasestr (const char *haystack, const char *needle); extern char * mbscasestr (const char *haystack, const char *needle)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSCSPN@ #if @GNULIB_MBSCSPN@
@@ -518,7 +530,8 @@ extern char * mbscasestr (const char *haystack, const char *needle);
beginning of the string to this occurrence, or to the end of the string beginning of the string to this occurrence, or to the end of the string
if none exists. if none exists.
Unlike strcspn(), this function works correctly in multibyte locales. */ Unlike strcspn(), this function works correctly in multibyte locales. */
extern size_t mbscspn (const char *string, const char *accept); extern size_t mbscspn (const char *string, const char *accept)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSPBRK@ #if @GNULIB_MBSPBRK@
@@ -527,7 +540,8 @@ extern size_t mbscspn (const char *string, const char *accept);
exists. exists.
Unlike strpbrk(), this function works correctly in multibyte locales. */ Unlike strpbrk(), this function works correctly in multibyte locales. */
# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
extern char * mbspbrk (const char *string, const char *accept); extern char * mbspbrk (const char *string, const char *accept)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSSPN@ #if @GNULIB_MBSSPN@
@@ -536,7 +550,8 @@ extern char * mbspbrk (const char *string, const char *accept);
beginning of the string to this occurrence, or to the end of the string beginning of the string to this occurrence, or to the end of the string
if none exists. if none exists.
Unlike strspn(), this function works correctly in multibyte locales. */ Unlike strspn(), this function works correctly in multibyte locales. */
extern size_t mbsspn (const char *string, const char *reject); extern size_t mbsspn (const char *string, const char *reject)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSSEP@ #if @GNULIB_MBSSEP@
@@ -554,7 +569,8 @@ extern size_t mbsspn (const char *string, const char *reject);
Caveat: The identity of the delimiting character is lost. Caveat: The identity of the delimiting character is lost.
See also mbstok_r(). */ See also mbstok_r(). */
extern char * mbssep (char **stringp, const char *delim); extern char * mbssep (char **stringp, const char *delim)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if @GNULIB_MBSTOK_R@ #if @GNULIB_MBSTOK_R@
@@ -574,7 +590,8 @@ extern char * mbssep (char **stringp, const char *delim);
Caveat: The identity of the delimiting character is lost. Caveat: The identity of the delimiting character is lost.
See also mbssep(). */ See also mbssep(). */
extern char * mbstok_r (char *string, const char *delim, char **save_ptr); extern char * mbstok_r (char *string, const char *delim, char **save_ptr)
_GL_ARG_NONNULL ((2, 3));
#endif #endif
/* Map any int, typically from errno, into an error message. */ /* Map any int, typically from errno, into an error message. */
@@ -609,7 +626,7 @@ extern char *strsignal (int __sig);
#if @GNULIB_STRVERSCMP@ #if @GNULIB_STRVERSCMP@
# if !@HAVE_STRVERSCMP@ # if !@HAVE_STRVERSCMP@
extern int strverscmp (const char *, const char *); extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strverscmp # undef strverscmp

View File

@@ -1,6 +1,6 @@
/* A substitute <strings.h>. /* A substitute <strings.h>.
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 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 it under the terms of the GNU General Public License as published by
@@ -31,6 +31,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -42,7 +44,8 @@ extern "C" {
than S2. than S2.
Note: This function does not work in multibyte locales. */ Note: This function does not work in multibyte locales. */
#if ! @HAVE_STRCASECMP@ #if ! @HAVE_STRCASECMP@
extern int strcasecmp (char const *s1, char const *s2); extern int strcasecmp (char const *s1, char const *s2)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if defined GNULIB_POSIXCHECK #if defined GNULIB_POSIXCHECK
/* strcasecmp() does not work with multibyte strings: /* strcasecmp() does not work with multibyte strings:
@@ -64,7 +67,8 @@ extern int strcasecmp (char const *s1, char const *s2);
lexicographically less than, equal to or greater than S2. lexicographically less than, equal to or greater than S2.
Note: This function cannot work correctly in multibyte locales. */ Note: This function cannot work correctly in multibyte locales. */
#if ! @HAVE_DECL_STRNCASECMP@ #if ! @HAVE_DECL_STRNCASECMP@
extern int strncasecmp (char const *s1, char const *s2, size_t n); extern int strncasecmp (char const *s1, char const *s2, size_t n)
_GL_ARG_NONNULL ((1, 2));
#endif #endif
#if defined GNULIB_POSIXCHECK #if defined GNULIB_POSIXCHECK
/* strncasecmp() does not work with multibyte strings: /* strncasecmp() does not work with multibyte strings:

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1997, 1999, 2003, 2006, 2008 Free /* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2009 Free
Software Foundation, Inc. Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -16,6 +16,10 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the nptr == NULL test below. */
#define _GL_ARG_NONNULL(params)
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>

View File

@@ -43,6 +43,8 @@
#ifndef _GL_SYS_SOCKET_H #ifndef _GL_SYS_SOCKET_H
#define _GL_SYS_SOCKET_H #define _GL_SYS_SOCKET_H
/* The definition of _GL_ARG_NONNULL is copied here. */
#if !@HAVE_SA_FAMILY_T@ #if !@HAVE_SA_FAMILY_T@
typedef unsigned short sa_family_t; typedef unsigned short sa_family_t;
#endif #endif
@@ -195,7 +197,7 @@ extern int rpl_socket (int, int, int protocol);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef connect # undef connect
# define connect rpl_connect # define connect rpl_connect
extern int rpl_connect (int, struct sockaddr *, int); extern int rpl_connect (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef connect # undef connect
@@ -229,7 +231,7 @@ extern int rpl_accept (int, struct sockaddr *, int *);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef bind # undef bind
# define bind rpl_bind # define bind rpl_bind
extern int rpl_bind (int, struct sockaddr *, int); extern int rpl_bind (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef bind # undef bind
@@ -246,7 +248,8 @@ extern int rpl_bind (int, struct sockaddr *, int);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef getpeername # undef getpeername
# define getpeername rpl_getpeername # define getpeername rpl_getpeername
extern int rpl_getpeername (int, struct sockaddr *, int *); extern int rpl_getpeername (int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef getpeername # undef getpeername
@@ -263,7 +266,8 @@ extern int rpl_getpeername (int, struct sockaddr *, int *);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef getsockname # undef getsockname
# define getsockname rpl_getsockname # define getsockname rpl_getsockname
extern int rpl_getsockname (int, struct sockaddr *, int *); extern int rpl_getsockname (int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef getsockname # undef getsockname
@@ -280,7 +284,8 @@ extern int rpl_getsockname (int, struct sockaddr *, int *);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef getsockopt # undef getsockopt
# define getsockopt rpl_getsockopt # define getsockopt rpl_getsockopt
extern int rpl_getsockopt (int, int, int, void *, socklen_t *); extern int rpl_getsockopt (int, int, int, void *, socklen_t *)
_GL_ARG_NONNULL ((4, 5));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef getsockopt # undef getsockopt
@@ -314,7 +319,7 @@ extern int rpl_listen (int, int);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef recv # undef recv
# define recv rpl_recv # define recv rpl_recv
extern int rpl_recv (int, void *, int, int); extern int rpl_recv (int, void *, int, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef recv # undef recv
@@ -331,7 +336,7 @@ extern int rpl_recv (int, void *, int, int);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef send # undef send
# define send rpl_send # define send rpl_send
extern int rpl_send (int, const void *, int, int); extern int rpl_send (int, const void *, int, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef send # undef send
@@ -348,7 +353,8 @@ extern int rpl_send (int, const void *, int, int);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef recvfrom # undef recvfrom
# define recvfrom rpl_recvfrom # define recvfrom rpl_recvfrom
extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *); extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef recvfrom # undef recvfrom
@@ -365,7 +371,8 @@ extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef sendto # undef sendto
# define sendto rpl_sendto # define sendto rpl_sendto
extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int); extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int)
_GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef sendto # undef sendto
@@ -382,7 +389,8 @@ extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# undef setsockopt # undef setsockopt
# define setsockopt rpl_setsockopt # define setsockopt rpl_setsockopt
extern int rpl_setsockopt (int, int, int, const void *, socklen_t); extern int rpl_setsockopt (int, int, int, const void *, socklen_t)
_GL_ARG_NONNULL ((4));
# endif # endif
# elif @HAVE_WINSOCK2_H@ # elif @HAVE_WINSOCK2_H@
# undef setsockopt # undef setsockopt

View File

@@ -49,6 +49,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* Before doing "#define mkdir rpl_mkdir" below, we need to include all /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
headers that may declare mkdir(). */ headers that may declare mkdir(). */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
@@ -295,7 +297,8 @@ extern "C" {
#if @GNULIB_FCHMODAT@ #if @GNULIB_FCHMODAT@
# if !@HAVE_FCHMODAT@ # if !@HAVE_FCHMODAT@
extern int fchmodat (int fd, char const *file, mode_t mode, int flag); extern int fchmodat (int fd, char const *file, mode_t mode, int flag)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fchmodat # undef fchmodat
@@ -308,7 +311,7 @@ extern int fchmodat (int fd, char const *file, mode_t mode, int flag);
#if @REPLACE_FSTAT@ #if @REPLACE_FSTAT@
# define fstat rpl_fstat # define fstat rpl_fstat
extern int fstat (int fd, struct stat *buf); extern int fstat (int fd, struct stat *buf) _GL_ARG_NONNULL ((2));
#endif #endif
@@ -318,7 +321,8 @@ extern int fstat (int fd, struct stat *buf);
# define fstatat rpl_fstatat # define fstatat rpl_fstatat
# endif # endif
# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@ # if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@
extern int fstatat (int fd, char const *name, struct stat *st, int flags); extern int fstatat (int fd, char const *name, struct stat *st, int flags)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fstatat # undef fstatat
@@ -360,7 +364,7 @@ extern int futimens (int fd, struct timespec const times[2]);
# define lchmod chmod # define lchmod chmod
# endif # endif
# if 0 /* assume already declared */ # if 0 /* assume already declared */
extern int lchmod (const char *filename, mode_t mode); extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lchmod # undef lchmod
@@ -379,7 +383,8 @@ extern int lchmod (const char *filename, mode_t mode);
# elif @REPLACE_LSTAT@ # elif @REPLACE_LSTAT@
# undef lstat # undef lstat
# define lstat rpl_lstat # define lstat rpl_lstat
extern int rpl_lstat (const char *name, struct stat *buf); extern int rpl_lstat (const char *name, struct stat *buf)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lstat # undef lstat
@@ -393,7 +398,7 @@ extern int rpl_lstat (const char *name, struct stat *buf);
#if @REPLACE_MKDIR@ #if @REPLACE_MKDIR@
# undef mkdir # undef mkdir
# define mkdir rpl_mkdir # define mkdir rpl_mkdir
extern int mkdir (char const *name, mode_t mode); extern int mkdir (char const *name, mode_t mode) _GL_ARG_NONNULL ((1));
#else #else
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
Additionally, it declares _mkdir (and depending on compile flags, an Additionally, it declares _mkdir (and depending on compile flags, an
@@ -413,7 +418,8 @@ rpl_mkdir (char const *name, mode_t mode)
#if @GNULIB_MKDIRAT@ #if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@ # if !@HAVE_MKDIRAT@
extern int mkdirat (int fd, char const *file, mode_t mode); extern int mkdirat (int fd, char const *file, mode_t mode)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkdirat # undef mkdirat
@@ -430,7 +436,7 @@ extern int mkdirat (int fd, char const *file, mode_t mode);
# define mkfifo rpl_mkfifo # define mkfifo rpl_mkfifo
# endif # endif
# if !@HAVE_MKFIFO@ || @REPLACE_MKFIFO@ # if !@HAVE_MKFIFO@ || @REPLACE_MKFIFO@
int mkfifo (char const *file, mode_t mode); extern int mkfifo (char const *file, mode_t mode) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkfifo # undef mkfifo
@@ -443,7 +449,8 @@ int mkfifo (char const *file, mode_t mode);
#if @GNULIB_MKFIFOAT@ #if @GNULIB_MKFIFOAT@
# if !@HAVE_MKFIFOAT@ # if !@HAVE_MKFIFOAT@
int mkfifoat (int fd, char const *file, mode_t mode); extern int mkfifoat (int fd, char const *file, mode_t mode)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkfifoat # undef mkfifoat
@@ -460,7 +467,8 @@ int mkfifoat (int fd, char const *file, mode_t mode);
# define mknod rpl_mknod # define mknod rpl_mknod
# endif # endif
# if !@HAVE_MKNOD@ || @REPLACE_MKNOD@ # if !@HAVE_MKNOD@ || @REPLACE_MKNOD@
int mknod (char const *file, mode_t mode, dev_t dev); extern int mknod (char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mknod # undef mknod
@@ -473,7 +481,8 @@ int mknod (char const *file, mode_t mode, dev_t dev);
#if @GNULIB_MKNODAT@ #if @GNULIB_MKNODAT@
# if !@HAVE_MKNODAT@ # if !@HAVE_MKNODAT@
int mknodat (int fd, char const *file, mode_t mode, dev_t dev); extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mknodat # undef mknodat
@@ -499,7 +508,7 @@ int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
# else /* !_LARGE_FILES */ # else /* !_LARGE_FILES */
# define stat(name, st) rpl_stat (name, st) # define stat(name, st) rpl_stat (name, st)
# endif /* !_LARGE_FILES */ # endif /* !_LARGE_FILES */
extern int stat (const char *name, struct stat *buf); extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stat # undef stat
@@ -517,7 +526,8 @@ extern int stat (const char *name, struct stat *buf);
# endif # endif
# if !@HAVE_UTIMENSAT@ || @REPLACE_UTIMENSAT@ # if !@HAVE_UTIMENSAT@ || @REPLACE_UTIMENSAT@
extern int utimensat (int fd, char const *name, extern int utimensat (int fd, char const *name,
struct timespec const times[2], int flag); struct timespec const times[2], int flag)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef utimensat # undef utimensat

View File

@@ -1,6 +1,6 @@
/* Provide a more complete sys/time.h. /* Provide a more complete sys/time.h.
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 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 it under the terms of the GNU General Public License as published by
@@ -39,6 +39,8 @@
# include <time.h> # include <time.h>
# endif # endif
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -54,7 +56,8 @@ struct timeval
# if @REPLACE_GETTIMEOFDAY@ # if @REPLACE_GETTIMEOFDAY@
# undef gettimeofday # undef gettimeofday
# define gettimeofday rpl_gettimeofday # define gettimeofday rpl_gettimeofday
int gettimeofday (struct timeval *restrict, void *restrict); extern int gettimeofday (struct timeval *restrict, void *restrict)
_GL_ARG_NONNULL ((1));
# endif # endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -1,5 +1,5 @@
/* Provide a sys/times.h header file. /* Provide a sys/times.h header file.
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 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 it under the terms of the GNU General Public License as published by
@@ -28,6 +28,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# endif # endif
@@ -43,7 +45,7 @@ extern "C" {
}; };
# if @GNULIB_TIMES@ # if @GNULIB_TIMES@
extern clock_t times (struct tms *buffer); extern clock_t times (struct tms *buffer) _GL_ARG_NONNULL ((1));
# elif defined GNULIB_POSIXCHECK # elif defined GNULIB_POSIXCHECK
# undef times # undef times
# define times(s) \ # define times(s) \

View File

@@ -20,6 +20,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -65,7 +67,7 @@ struct utsname
#if @GNULIB_UNAME@ #if @GNULIB_UNAME@
# if !@HAVE_UNAME@ # if !@HAVE_UNAME@
extern int uname (struct utsname *buf); extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef uname # undef uname

View File

@@ -40,6 +40,8 @@
/* NetBSD 5.0 mis-defines NULL. */ /* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h> #include <stddef.h>
/* The definition of _GL_ARG_NONNULL is copied here. */
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# endif # endif
@@ -66,13 +68,14 @@ struct timespec
<http://www.opengroup.org/susv3xsh/nanosleep.html>. */ <http://www.opengroup.org/susv3xsh/nanosleep.html>. */
# if @REPLACE_NANOSLEEP@ # if @REPLACE_NANOSLEEP@
# define nanosleep rpl_nanosleep # define nanosleep rpl_nanosleep
int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp); extern int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp)
_GL_ARG_NONNULL ((1));
# endif # endif
/* Return the 'time_t' representation of TP and normalize TP. */ /* Return the 'time_t' representation of TP and normalize TP. */
# if @REPLACE_MKTIME@ # if @REPLACE_MKTIME@
# define mktime rpl_mktime # define mktime rpl_mktime
extern time_t mktime (struct tm *__tp); extern time_t mktime (struct tm *__tp) _GL_ARG_NONNULL ((1));
# endif # endif
/* Convert TIMER to RESULT, assuming local time and UTC respectively. See /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
@@ -83,10 +86,12 @@ extern time_t mktime (struct tm *__tp);
# define localtime_r rpl_localtime_r # define localtime_r rpl_localtime_r
# undef gmtime_r # undef gmtime_r
# define gmtime_r rpl_gmtime_r # define gmtime_r rpl_gmtime_r
struct tm *localtime_r (time_t const *restrict __timer, extern struct tm *localtime_r (time_t const *restrict __timer,
struct tm *restrict __result); struct tm *restrict __result)
struct tm *gmtime_r (time_t const *restrict __timer, _GL_ARG_NONNULL ((1, 2));
struct tm *restrict __result); extern struct tm *gmtime_r (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
@@ -95,15 +100,17 @@ struct tm *gmtime_r (time_t const *restrict __timer,
# if @REPLACE_STRPTIME@ # if @REPLACE_STRPTIME@
# undef strptime # undef strptime
# define strptime rpl_strptime # define strptime rpl_strptime
char *strptime (char const *restrict __buf, char const *restrict __format, extern char *strptime (char const *restrict __buf,
struct tm *restrict __tm); char const *restrict __format,
struct tm *restrict __tm)
_GL_ARG_NONNULL ((1, 2, 3));
# endif # endif
/* Convert TM to a time_t value, assuming UTC. */ /* Convert TM to a time_t value, assuming UTC. */
# if @REPLACE_TIMEGM@ # if @REPLACE_TIMEGM@
# undef timegm # undef timegm
# define timegm rpl_timegm # define timegm rpl_timegm
time_t timegm (struct tm *__tm); extern time_t timegm (struct tm *__tm) _GL_ARG_NONNULL ((1));
# endif # endif
/* Encourage applications to avoid unsafe functions that can overrun /* Encourage applications to avoid unsafe functions that can overrun

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1995-1997, 2000, 2006-2007 Free Software Foundation, Inc. /* Copyright (C) 1995-1997, 2000, 2006-2007, 2009 Free Software Foundation, Inc.
Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997. Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
NOTE: The canonical source of this file is maintained with the GNU C NOTE: The canonical source of this file is maintained with the GNU C
@@ -86,6 +86,10 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the rootp == NULL tests below. */
#define _GL_ARG_NONNULL(params)
/* Specification. */ /* Specification. */
#ifdef IN_LIBINTL #ifdef IN_LIBINTL
# include "tsearch.h" # include "tsearch.h"

View File

@@ -96,6 +96,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* OS/2 EMX lacks these macros. */ /* OS/2 EMX lacks these macros. */
#ifndef STDIN_FILENO #ifndef STDIN_FILENO
@@ -135,7 +137,8 @@ extern "C" {
Return 0 if successful, otherwise -1 and errno set. Return 0 if successful, otherwise -1 and errno set.
See the POSIX:2001 specification See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/chown.html>. */ <http://www.opengroup.org/susv3xsh/chown.html>. */
extern int chown (const char *file, uid_t uid, gid_t gid); extern int chown (const char *file, uid_t uid, gid_t gid)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef chown # undef chown
@@ -239,7 +242,7 @@ extern char **environ;
# if !@HAVE_EUIDACCESS@ # if !@HAVE_EUIDACCESS@
/* Like access(), except that it uses the effective user id and group id of /* Like access(), except that it uses the effective user id and group id of
the current process. */ the current process. */
extern int euidaccess (const char *filename, int mode); extern int euidaccess (const char *filename, int mode) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef euidaccess # undef euidaccess
@@ -252,7 +255,8 @@ extern int euidaccess (const char *filename, int mode);
#if @GNULIB_FACCESSAT@ #if @GNULIB_FACCESSAT@
# if !@HAVE_FACCESSAT@ # if !@HAVE_FACCESSAT@
int faccessat (int fd, char const *file, int mode, int flag); extern int faccessat (int fd, char const *file, int mode, int flag)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef faccessat # undef faccessat
@@ -273,7 +277,8 @@ int faccessat (int fd, char const *file, int mode, int flag);
extern int fchdir (int /*fd*/); extern int fchdir (int /*fd*/);
/* Gnulib internal hooks needed to maintain the fchdir metadata. */ /* Gnulib internal hooks needed to maintain the fchdir metadata. */
extern int _gl_register_fd (int fd, const char *filename); extern int _gl_register_fd (int fd, const char *filename)
_GL_ARG_NONNULL ((2));
extern void _gl_unregister_fd (int fd); extern void _gl_unregister_fd (int fd);
extern int _gl_register_dup (int oldfd, int newfd); extern int _gl_register_dup (int oldfd, int newfd);
extern const char *_gl_directory_name (int fd); extern const char *_gl_directory_name (int fd);
@@ -294,7 +299,8 @@ extern const char *_gl_directory_name (int fd);
# define fchownat rpl_fchownat # define fchownat rpl_fchownat
# endif # endif
# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@ # if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fchownat # undef fchownat
@@ -378,7 +384,7 @@ extern char * getcwd (char *buf, size_t size);
If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
Return 0 if successful, otherwise set errno and return -1. */ Return 0 if successful, otherwise set errno and return -1. */
# if !@HAVE_GETDOMAINNAME@ # if !@HAVE_GETDOMAINNAME@
extern int getdomainname(char *name, size_t len); extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getdomainname # undef getdomainname
@@ -439,7 +445,7 @@ int getgroups (int n, gid_t *groups);
# define gethostname rpl_gethostname # define gethostname rpl_gethostname
# endif # endif
# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ # if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
extern int gethostname(char *name, size_t len); extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
# endif # endif
#elif @UNISTD_H_HAVE_WINSOCK2_H@ #elif @UNISTD_H_HAVE_WINSOCK2_H@
# undef gethostname # undef gethostname
@@ -464,7 +470,7 @@ extern int gethostname(char *name, size_t len);
See <http://www.opengroup.org/susv3xsh/getlogin.html>. See <http://www.opengroup.org/susv3xsh/getlogin.html>.
*/ */
# if !@HAVE_DECL_GETLOGIN_R@ # if !@HAVE_DECL_GETLOGIN_R@
extern int getlogin_r (char *name, size_t size); extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getlogin_r # undef getlogin_r
@@ -574,7 +580,8 @@ extern void endusershell (void);
Return 0 if successful, otherwise -1 and errno set. Return 0 if successful, otherwise -1 and errno set.
See the POSIX:2001 specification See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/lchown.html>. */ <http://www.opengroup.org/susv3xsh/lchown.html>. */
extern int lchown (char const *file, uid_t owner, gid_t group); extern int lchown (char const *file, uid_t owner, gid_t group)
_GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lchown # undef lchown
@@ -594,7 +601,8 @@ extern int lchown (char const *file, uid_t owner, gid_t group);
See POSIX:2001 specification See POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/link.html>. */ <http://www.opengroup.org/susv3xsh/link.html>. */
# if !@HAVE_LINK@ || @REPLACE_LINK@ # if !@HAVE_LINK@ || @REPLACE_LINK@
extern int link (const char *path1, const char *path2); extern int link (const char *path1, const char *path2)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef link # undef link
@@ -614,7 +622,8 @@ extern int link (const char *path1, const char *path2);
Return 0 if successful, otherwise -1 and errno set. */ Return 0 if successful, otherwise -1 and errno set. */
# if !@HAVE_LINKAT@ || @REPLACE_LINKAT@ # if !@HAVE_LINKAT@ || @REPLACE_LINKAT@
extern int linkat (int fd1, const char *path1, int fd2, const char *path2, extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
int flag); int flag)
_GL_ARG_NONNULL ((2, 4));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef linkat # undef linkat
@@ -654,7 +663,7 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
# if @HAVE_PIPE2@ # if @HAVE_PIPE2@
# define pipe2 rpl_pipe2 # define pipe2 rpl_pipe2
# endif # endif
extern int pipe2 (int fd[2], int flags); extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef pipe2 # undef pipe2
# define pipe2(f,o) \ # define pipe2(f,o) \
@@ -673,7 +682,8 @@ extern int pipe2 (int fd[2], int flags);
set errno and return -1. 0 indicates EOF. See the POSIX:2001 set errno and return -1. 0 indicates EOF. See the POSIX:2001
specification <http://www.opengroup.org/susv3xsh/pread.html>. */ specification <http://www.opengroup.org/susv3xsh/pread.html>. */
# if !@HAVE_PREAD@ || @REPLACE_PREAD@ # if !@HAVE_PREAD@ || @REPLACE_PREAD@
extern ssize_t pread (int fd, void *buf, size_t bufsize, off_t offset); extern ssize_t pread (int fd, void *buf, size_t bufsize, off_t offset)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef pread # undef pread
@@ -694,7 +704,8 @@ extern int pipe2 (int fd[2], int flags);
See the POSIX:2001 specification See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/readlink.html>. */ <http://www.opengroup.org/susv3xsh/readlink.html>. */
# if !@HAVE_READLINK@ || @REPLACE_READLINK@ # if !@HAVE_READLINK@ || @REPLACE_READLINK@
extern ssize_t readlink (const char *file, char *buf, size_t bufsize); extern ssize_t readlink (const char *file, char *buf, size_t bufsize)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef readlink # undef readlink
@@ -707,7 +718,8 @@ extern ssize_t readlink (const char *file, char *buf, size_t bufsize);
#if @GNULIB_READLINKAT@ #if @GNULIB_READLINKAT@
# if !@HAVE_READLINKAT@ # if !@HAVE_READLINKAT@
ssize_t readlinkat (int fd, char const *file, char *buf, size_t len); extern ssize_t readlinkat (int fd, char const *file, char *buf, size_t len)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef readlinkat # undef readlinkat
@@ -722,7 +734,7 @@ ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
# if @REPLACE_RMDIR@ # if @REPLACE_RMDIR@
# define rmdir rpl_rmdir # define rmdir rpl_rmdir
/* Remove the directory DIR. */ /* Remove the directory DIR. */
extern int rmdir (char const *name); extern int rmdir (char const *name) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rmdir # undef rmdir
@@ -760,7 +772,8 @@ extern unsigned int sleep (unsigned int n);
# define symlink rpl_symlink # define symlink rpl_symlink
# endif # endif
# if !@HAVE_SYMLINK@ || @REPLACE_SYMLINK@ # if !@HAVE_SYMLINK@ || @REPLACE_SYMLINK@
int symlink (char const *contents, char const *file); extern int symlink (char const *contents, char const *file)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef symlink # undef symlink
@@ -773,7 +786,8 @@ int symlink (char const *contents, char const *file);
#if @GNULIB_SYMLINKAT@ #if @GNULIB_SYMLINKAT@
# if !@HAVE_SYMLINKAT@ # if !@HAVE_SYMLINKAT@
int symlinkat (char const *contents, int fd, char const *file); extern int symlinkat (char const *contents, int fd, char const *file)
_GL_ARG_NONNULL ((1, 3));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef symlinkat # undef symlinkat
@@ -788,7 +802,7 @@ int symlinkat (char const *contents, int fd, char const *file);
# if @REPLACE_UNLINK@ # if @REPLACE_UNLINK@
# undef unlink # undef unlink
# define unlink rpl_unlink # define unlink rpl_unlink
extern int unlink (char const *file); extern int unlink (char const *file) _GL_ARG_NONNULL ((1));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef unlink # undef unlink
@@ -805,7 +819,7 @@ extern int unlink (char const *file);
# define unlinkat rpl_unlinkat # define unlinkat rpl_unlinkat
# endif # endif
# if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@ # if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@
extern int unlinkat (int fd, char const *file, int flag); extern int unlinkat (int fd, char const *file, int flag) _GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef unlinkat # undef unlinkat
@@ -843,7 +857,8 @@ extern int usleep (useconds_t n);
<http://www.opengroup.org/susv3xsh/write.html>. */ <http://www.opengroup.org/susv3xsh/write.html>. */
# undef write # undef write
# define write rpl_write # define write rpl_write
extern ssize_t write (int fd, const void *buf, size_t count); extern ssize_t write (int fd, const void *buf, size_t count)
_GL_ARG_NONNULL ((2));
#endif #endif

View File

@@ -16,6 +16,10 @@
#include <config.h> #include <config.h>
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
optimizes away the name == NULL test below. */
#define _GL_ARG_NONNULL(params)
/* Specification. */ /* Specification. */
#include <stdlib.h> #include <stdlib.h>

View File

@@ -74,6 +74,8 @@
/* The definition of GL_LINK_WARNING is copied here. */ /* The definition of GL_LINK_WARNING is copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -197,7 +199,8 @@ extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
# define mbsrtowcs rpl_mbsrtowcs # define mbsrtowcs rpl_mbsrtowcs
# endif # endif
# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@ # if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps); extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbsrtowcs # undef mbsrtowcs
@@ -215,7 +218,8 @@ extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t
# define mbsnrtowcs rpl_mbsnrtowcs # define mbsnrtowcs rpl_mbsnrtowcs
# endif # endif
# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@ # if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps); extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbsnrtowcs # undef mbsnrtowcs
@@ -251,7 +255,8 @@ extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
# define wcsrtombs rpl_wcsrtombs # define wcsrtombs rpl_wcsrtombs
# endif # endif
# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@ # if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps); extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcsrtombs # undef wcsrtombs
@@ -269,7 +274,8 @@ extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t
# define wcsnrtombs rpl_wcsnrtombs # define wcsnrtombs rpl_wcsnrtombs
# endif # endif
# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@ # if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@
extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps); extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcsnrtombs # undef wcsnrtombs

31
modules/arg-nonnull Normal file
View File

@@ -0,0 +1,31 @@
Description:
A C macro for declaring that specific arguments must not be NULL.
Files:
build-aux/arg-nonnull.h
Depends-on:
configure.ac:
Makefile.am:
BUILT_SOURCES += arg-nonnull.h
# The arg-nonnull.h that gets inserted into generated .h files is the same as
# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/GL_ARG_NONNULL/,$$p' \
< $(top_srcdir)/build-aux/arg-nonnull.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
ARG_NONNULL_H=arg-nonnull.h
Include:
License:
LGPLv2+
Maintainer:
Bruno Haible

View File

@@ -6,6 +6,7 @@ lib/argv-iter.c
lib/argv-iter.h lib/argv-iter.h
Depends-on: Depends-on:
arg-nonnull
getdelim getdelim
stdbool stdbool

View File

@@ -8,6 +8,7 @@ m4/arpa_inet_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
sys_socket sys_socket
configure.ac: configure.ac:
@@ -19,7 +20,7 @@ BUILT_SOURCES += $(ARPA_INET_H)
# We need the following in order to create <arpa/inet.h> when the system # We need the following in order to create <arpa/inet.h> when the system
# doesn't have one. # doesn't have one.
arpa/inet.h: arpa_inet.in.h $(LINK_WARNING_H) arpa/inet.h: arpa_inet.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) arpa $(AM_V_at)$(MKDIR_P) arpa
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -32,6 +33,7 @@ arpa/inet.h: arpa_inet.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
-e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/arpa_inet.in.h; \ < $(srcdir)/arpa_inet.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/unistd_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_DIRENT_H gl_DIRENT_H
@@ -18,7 +19,7 @@ BUILT_SOURCES += $(DIRENT_H)
# We need the following in order to create <dirent.h> when the system # We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
dirent.h: dirent.in.h $(LINK_WARNING_H) dirent.h: dirent.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -36,6 +37,7 @@ dirent.h: dirent.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \ -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \ -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/dirent.in.h; \ < $(srcdir)/dirent.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/fcntl_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
unistd unistd
extensions extensions
@@ -19,7 +20,7 @@ BUILT_SOURCES += $(FCNTL_H)
# We need the following in order to create <fcntl.h> when the system # We need the following in order to create <fcntl.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h $(LINK_WARNING_H) fcntl.h: fcntl.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -31,6 +32,7 @@ fcntl.h: fcntl.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/fcntl.in.h; \ < $(srcdir)/fcntl.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/mbstate_t.m4
m4/fnmatch.m4 m4/fnmatch.m4
Depends-on: Depends-on:
arg-nonnull
extensions extensions
alloca alloca
stdbool stdbool
@@ -27,10 +28,11 @@ BUILT_SOURCES += $(FNMATCH_H)
# We need the following in order to create <fnmatch.h> when the system # We need the following in order to create <fnmatch.h> when the system
# doesn't have one that supports the required API. # doesn't have one that supports the required API.
fnmatch.h: fnmatch.in.h fnmatch.h: fnmatch.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/fnmatch.in.h; \ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/fnmatch.in.h; \
} > $@-t && \ } > $@-t && \
mv -f $@-t $@ mv -f $@-t $@
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t

View File

@@ -13,6 +13,7 @@ gettext-h
unistd unistd
extensions extensions
include_next include_next
arg-nonnull
configure.ac: configure.ac:
gl_FUNC_GETOPT_POSIX gl_FUNC_GETOPT_POSIX
@@ -22,7 +23,7 @@ BUILT_SOURCES += $(GETOPT_H)
# We need the following in order to create <getopt.h> when the system # We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
getopt.h: getopt.in.h $(LINK_WARNING_H) getopt.h: getopt.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
@@ -30,6 +31,7 @@ getopt.h: getopt.in.h $(LINK_WARNING_H)
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/getopt.in.h; \ < $(srcdir)/getopt.in.h; \
} > $@-t && \ } > $@-t && \
mv -f $@-t $@ mv -f $@-t $@

View File

@@ -10,6 +10,7 @@ m4/glob.m4
Depends-on: Depends-on:
alloca alloca
arg-nonnull
d-type d-type
dirfd dirfd
extensions extensions
@@ -31,10 +32,11 @@ BUILT_SOURCES += $(GLOB_H)
# We need the following in order to create <glob.h> when the system # We need the following in order to create <glob.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
glob.h: glob.in.h glob.h: glob.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/glob.in.h; \ < $(srcdir)/glob.in.h; \
} > $@-t && \ } > $@-t && \
mv -f $@-t $@ mv -f $@-t $@

View File

@@ -15,6 +15,7 @@ m4/iconv_open.m4
Depends-on: Depends-on:
gperf gperf
include_next include_next
arg-nonnull
iconv iconv
c-ctype c-ctype
c-strcase c-strcase
@@ -28,7 +29,7 @@ BUILT_SOURCES += $(ICONV_H)
# We need the following in order to create <iconv.h> when the system # We need the following in order to create <iconv.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
iconv.h: iconv.in.h iconv.h: iconv.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -38,6 +39,7 @@ iconv.h: iconv.in.h
-e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
-e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
-e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/iconv.in.h; \ < $(srcdir)/iconv.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/inttypes.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
multiarch multiarch
stdint stdint
@@ -20,7 +21,7 @@ BUILT_SOURCES += $(INTTYPES_H)
# We need the following in order to create <inttypes.h> when the system # We need the following in order to create <inttypes.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
inttypes.h: inttypes.in.h $(LINK_WARNING_H) inttypes.h: inttypes.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
@@ -45,6 +46,7 @@ inttypes.h: inttypes.in.h $(LINK_WARNING_H)
-e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
-e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/inttypes.in.h; \ < $(srcdir)/inttypes.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -7,6 +7,7 @@ m4/locale_h.m4
Depends-on: Depends-on:
include_next include_next
arg-nonnull
extensions extensions
stddef stddef
@@ -18,7 +19,7 @@ BUILT_SOURCES += $(LOCALE_H)
# We need the following in order to create <locale.h> when the system # We need the following in order to create <locale.h> when the system
# doesn't have one that provides all definitions. # doesn't have one that provides all definitions.
locale.h: locale.in.h locale.h: locale.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -27,6 +28,7 @@ locale.h: locale.in.h
-e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \ -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
-e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
-e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/locale.in.h; \ < $(srcdir)/locale.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/math_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_MATH_H gl_MATH_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += math.h
# We need the following in order to create <math.h> when the system # We need the following in order to create <math.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
math.h: math.in.h $(LINK_WARNING_H) math.h: math.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
@@ -79,6 +80,7 @@ math.h: math.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
-e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/math.in.h; \ < $(srcdir)/math.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -7,6 +7,7 @@ m4/netdb_h.m4
Depends-on: Depends-on:
include_next include_next
arg-nonnull
sys_socket sys_socket
configure.ac: configure.ac:
@@ -17,7 +18,7 @@ BUILT_SOURCES += $(NETDB_H)
# We need the following in order to create <netdb.h> when the system # We need the following in order to create <netdb.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
netdb.h: netdb.in.h netdb.h: netdb.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -30,6 +31,7 @@ netdb.h: netdb.in.h
-e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \ -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
-e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
-e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/netdb.in.h; \ < $(srcdir)/netdb.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/search_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_SEARCH_H gl_SEARCH_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += search.h
# We need the following in order to create <search.h> when the system # We need the following in order to create <search.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
search.h: search.in.h $(LINK_WARNING_H) search.h: search.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''HAVE_SEARCH_H''@|$(HAVE_SEARCH_H)|g' \ sed -e 's|@''HAVE_SEARCH_H''@|$(HAVE_SEARCH_H)|g' \
@@ -28,6 +29,7 @@ search.h: search.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_TSEARCH''@|$(HAVE_TSEARCH)|g' \ -e 's|@''HAVE_TSEARCH''@|$(HAVE_TSEARCH)|g' \
-e 's|@''REPLACE_TSEARCH''@|$(REPLACE_TSEARCH)|g' \ -e 's|@''REPLACE_TSEARCH''@|$(REPLACE_TSEARCH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/search.in.h; \ < $(srcdir)/search.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/signal_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_SIGNAL_H gl_SIGNAL_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += signal.h
# We need the following in order to create <signal.h> when the system # We need the following in order to create <signal.h> when the system
# doesn't have a complete one. # doesn't have a complete one.
signal.h: signal.in.h $(LINK_WARNING_H) signal.h: signal.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -33,6 +34,7 @@ signal.h: signal.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/signal.in.h; \ < $(srcdir)/signal.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/spawn_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
sched sched
configure.ac: configure.ac:
@@ -18,7 +19,7 @@ BUILT_SOURCES += $(SPAWN_H)
# We need the following in order to create a replacement for <spawn.h> when # We need the following in order to create a replacement for <spawn.h> when
# the system doesn't have one. # the system doesn't have one.
spawn.h: spawn.in.h $(LINK_WARNING_H) spawn.h: spawn.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ sed -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \
@@ -49,6 +50,7 @@ spawn.h: spawn.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \ -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \
-e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \ -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/spawn.in.h; \ < $(srcdir)/spawn.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/stdio_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
raise raise
stddef stddef
@@ -20,7 +21,7 @@ BUILT_SOURCES += stdio.h
# We need the following in order to create <stdio.h> when the system # We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(LINK_WARNING_H) stdio.h: stdio.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -105,6 +106,7 @@ stdio.h: stdio.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/stdio.in.h; \ < $(srcdir)/stdio.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/stdlib_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
unistd unistd
stddef stddef
stdint stdint
@@ -20,7 +21,7 @@ BUILT_SOURCES += stdlib.h
# We need the following in order to create <stdlib.h> when the system # We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h $(LINK_WARNING_H) stdlib.h: stdlib.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -77,6 +78,7 @@ stdlib.h: stdlib.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/stdlib.in.h; \ < $(srcdir)/stdlib.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ Depends-on:
extensions extensions
include_next include_next
link-warning link-warning
arg-nonnull
stddef stddef
configure.ac: configure.ac:
@@ -19,7 +20,7 @@ BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system # We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
string.h: string.in.h $(LINK_WARNING_H) string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -86,6 +87,7 @@ string.h: string.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/string.in.h; \ < $(srcdir)/string.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/strings_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_HEADER_STRINGS_H gl_HEADER_STRINGS_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += strings.h
# We need the following in order to create <strings.h> when the system # We need the following in order to create <strings.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
strings.h: strings.in.h $(LINK_WARNING_H) strings.h: strings.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -26,6 +27,7 @@ strings.h: strings.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/strings.in.h; \ < $(srcdir)/strings.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/sockpfaf.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
errno errno
alignof alignof
@@ -21,7 +22,7 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
# We need the following in order to create <sys/socket.h> when the system # We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h $(LINK_WARNING_H) sys/socket.h: sys_socket.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -51,6 +52,7 @@ sys/socket.h: sys_socket.in.h $(LINK_WARNING_H)
-e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
-e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/sys_socket.in.h; \ < $(srcdir)/sys_socket.in.h; \
} > $@-t && \ } > $@-t && \
mv -f $@-t $@ mv -f $@-t $@

View File

@@ -9,6 +9,7 @@ m4/unistd_h.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
time time
configure.ac: configure.ac:
@@ -20,7 +21,7 @@ BUILT_SOURCES += sys/stat.h
# We need the following in order to create <sys/stat.h> when the system # We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete. # has one that is incomplete.
sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -60,6 +61,7 @@ sys/stat.h: sys_stat.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
-e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/sys_stat.in.h; \ < $(srcdir)/sys_stat.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -7,6 +7,7 @@ m4/sys_time_h.m4
Depends-on: Depends-on:
include_next include_next
arg-nonnull
configure.ac: configure.ac:
gl_HEADER_SYS_TIME_H gl_HEADER_SYS_TIME_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += $(SYS_TIME_H)
# We need the following in order to create <sys/time.h> when the system # We need the following in order to create <sys/time.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h sys/time.h: sys_time.in.h $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -27,6 +28,7 @@ sys/time.h: sys_time.in.h
-e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/sys_time.in.h; \ < $(srcdir)/sys_time.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -7,6 +7,7 @@ m4/sys_times_h.m4
Depends-on: Depends-on:
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_SYS_TIMES_H gl_SYS_TIMES_H
@@ -17,12 +18,13 @@ BUILT_SOURCES += $(SYS_TIMES_H)
# We need the following in order to create <sys/times.h> when the system # We need the following in order to create <sys/times.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
sys/times.h: sys_times.in.h $(LINK_WARNING_H) sys/times.h: sys_times.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GNULIB_TIMES''@|$(GNULIB_TIMES)|g' \ sed -e 's|@''GNULIB_TIMES''@|$(GNULIB_TIMES)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/sys_times.in.h; \ < $(srcdir)/sys_times.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -7,6 +7,7 @@ m4/sys_utsname_h.m4
Depends-on: Depends-on:
link-warning link-warning
arg-nonnull
configure.ac: configure.ac:
gl_SYS_UTSNAME_H gl_SYS_UTSNAME_H
@@ -17,13 +18,14 @@ BUILT_SOURCES += $(SYS_UTSNAME_H)
# We need the following in order to create <sys/utsname.h> when the system # We need the following in order to create <sys/utsname.h> when the system
# does not have one. # does not have one.
sys/utsname.h: sys_utsname.in.h $(LINK_WARNING_H) sys/utsname.h: sys_utsname.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GNULIB_UNAME''@|$(GNULIB_UNAME)|g' \ sed -e 's|@''GNULIB_UNAME''@|$(GNULIB_UNAME)|g' \
-e 's|@''HAVE_UNAME''@|$(HAVE_UNAME)|g' \ -e 's|@''HAVE_UNAME''@|$(HAVE_UNAME)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/sys_utsname.in.h; \ < $(srcdir)/sys_utsname.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ m4/time_h.m4
Depends-on: Depends-on:
extensions extensions
include_next include_next
arg-nonnull
stddef stddef
configure.ac: configure.ac:
@@ -18,7 +19,7 @@ BUILT_SOURCES += time.h
# We need the following in order to create <time.h> when the system # We need the following in order to create <time.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
time.h: time.in.h time.h: time.in.h $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -31,6 +32,7 @@ time.h: time.in.h
-e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/time.in.h; \ < $(srcdir)/time.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -8,6 +8,7 @@ lib/unistd.in.h
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
stddef stddef
configure.ac: configure.ac:
@@ -18,7 +19,7 @@ BUILT_SOURCES += unistd.h
# We need the following in order to create an empty placeholder for # We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one. # <unistd.h> when the system doesn't have one.
unistd.h: unistd.in.h $(LINK_WARNING_H) unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
@@ -117,6 +118,7 @@ unistd.h: unistd.in.h $(LINK_WARNING_H)
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/unistd.in.h; \ < $(srcdir)/unistd.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -9,6 +9,7 @@ m4/wint_t.m4
Depends-on: Depends-on:
include_next include_next
link-warning link-warning
arg-nonnull
stddef stddef
configure.ac: configure.ac:
@@ -19,7 +20,7 @@ BUILT_SOURCES += $(WCHAR_H)
# We need the following in order to create <wchar.h> when the system # We need the following in order to create <wchar.h> when the system
# version does not work standalone. # version does not work standalone.
wchar.h: wchar.in.h $(LINK_WARNING_H) wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -62,6 +63,7 @@ wchar.h: wchar.in.h $(LINK_WARNING_H)
-e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
< $(srcdir)/wchar.in.h; \ < $(srcdir)/wchar.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@

View File

@@ -43,6 +43,12 @@
#define BASE "t-can-lgpl.tmp" #define BASE "t-can-lgpl.tmp"
static void *
null_ptr (void)
{
return NULL;
}
int int
main (void) main (void)
{ {
@@ -75,7 +81,7 @@ main (void)
ASSERT (result == NULL); ASSERT (result == NULL);
ASSERT (errno == ENOENT); ASSERT (errno == ENOENT);
errno = 0; errno = 0;
result = canonicalize_file_name (NULL); result = canonicalize_file_name (null_ptr ());
ASSERT (result == NULL); ASSERT (result == NULL);
ASSERT (errno == EINVAL); ASSERT (errno == EINVAL);
} }

View File

@@ -44,6 +44,12 @@
#define BASE "t-can.tmp" #define BASE "t-can.tmp"
static void *
null_ptr (void)
{
return NULL;
}
int int
main (void) main (void)
{ {
@@ -79,7 +85,7 @@ main (void)
ASSERT (result2 == NULL); ASSERT (result2 == NULL);
ASSERT (errno == ENOENT); ASSERT (errno == ENOENT);
errno = 0; errno = 0;
result1 = canonicalize_file_name (NULL); result1 = canonicalize_file_name (null_ptr ());
ASSERT (result1 == NULL); ASSERT (result1 == NULL);
ASSERT (errno == EINVAL); ASSERT (errno == EINVAL);
errno = 0; errno = 0;

View File

@@ -38,6 +38,12 @@
} \ } \
while (0) while (0)
static void *
null_ptr (void)
{
return NULL;
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@@ -88,7 +94,7 @@ main (int argc, char *argv[])
{ {
const char input[] = "foo"; const char input[] = "foo";
const char *result = memmem (input, strlen (input), NULL, 0); const char *result = memmem (input, strlen (input), null_ptr (), 0);
ASSERT (result == input); ASSERT (result == input);
} }