1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A GNU-like <stdio.h>.
5 Copyright (C) 2004, 2007-2013 Free Software Foundation, Inc.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <http://www.gnu.org/licenses/>. */
21 @PRAGMA_SYSTEM_HEADER@
25 #if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
26 /* Special invocation convention:
27 - Inside glibc header files.
28 - On OSF/1 5.1 we have a sequence of nested includes
29 <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
30 <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
31 In this situation, the functions are not yet declared, therefore we cannot
32 provide the C++ aliases. */
34 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
37 /* Normal invocation convention. */
39 #ifndef _@GUARD_PREFIX@_STDIO_H
41 #define _GL_ALREADY_INCLUDING_STDIO_H
43 /* The include_next requires a split double-inclusion guard. */
44 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
46 #undef _GL_ALREADY_INCLUDING_STDIO_H
48 #ifndef _@GUARD_PREFIX@_STDIO_H
49 #define _@GUARD_PREFIX@_STDIO_H
51 /* Get va_list. Needed on many systems, including glibc 2.8. */
56 /* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
58 May also define off_t to a 64-bit type on native Windows. */
59 #include <sys/types.h>
61 /* The __attribute__ feature is available in gcc versions 2.5 and later.
62 The __-protected variants of the attributes 'format' and 'printf' are
63 accepted by gcc versions 2.6.4 (effectively 2.7) and later.
64 We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
65 gnulib and libintl do '#define printf __printf__' when they override
66 the 'printf' function. */
67 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
68 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
70 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
73 /* _GL_ATTRIBUTE_FORMAT_PRINTF
74 indicates to GCC that the function takes a format string and arguments,
75 where the format string directives are the ones standardized by ISO C99
77 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
78 # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
79 _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
81 # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
82 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
85 /* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
86 except that it indicates to GCC that the supported format string directives
87 are the ones of the system printf(), rather than the ones standardized by
89 #define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
90 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
92 /* _GL_ATTRIBUTE_FORMAT_SCANF
93 indicates to GCC that the function takes a format string and arguments,
94 where the format string directives are the ones standardized by ISO C99
96 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
97 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
98 _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
100 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
101 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
104 /* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
105 except that it indicates to GCC that the supported format string directives
106 are the ones of the system scanf(), rather than the ones standardized by
107 ISO C99 and POSIX. */
108 #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
109 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
111 /* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>. */
112 /* But in any case avoid namespace pollution on glibc systems. */
113 #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
114 && ! defined __GLIBC__
119 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
121 /* The definition of _GL_ARG_NONNULL is copied here. */
123 /* The definition of _GL_WARN_ON_USE is copied here. */
125 /* Macros for stringification. */
126 #define _GL_STDIO_STRINGIZE(token) #token
127 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
131 # if @REPLACE_DPRINTF@
132 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
133 # define dprintf rpl_dprintf
135 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
136 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
137 _GL_ARG_NONNULL ((2)));
138 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
141 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
142 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
143 _GL_ARG_NONNULL ((2)));
145 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
147 _GL_CXXALIASWARN (dprintf);
148 #elif defined GNULIB_POSIXCHECK
150 # if HAVE_RAW_DECL_DPRINTF
151 _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
152 "use gnulib module dprintf for portability");
157 /* Close STREAM and its underlying file descriptor. */
158 # if @REPLACE_FCLOSE@
159 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
160 # define fclose rpl_fclose
162 _GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
163 _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
165 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
167 _GL_CXXALIASWARN (fclose);
168 #elif defined GNULIB_POSIXCHECK
170 /* Assume fclose is always declared. */
171 _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
172 "use gnulib module fclose for portable POSIX compliance");
176 # if @REPLACE_FDOPEN@
177 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
179 # define fdopen rpl_fdopen
181 _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
182 _GL_ARG_NONNULL ((2)));
183 _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
185 _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
187 _GL_CXXALIASWARN (fdopen);
188 #elif defined GNULIB_POSIXCHECK
190 /* Assume fdopen is always declared. */
191 _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
192 "use gnulib module fdopen for portability");
196 /* Flush all pending data on STREAM according to POSIX rules. Both
197 output and seekable input streams are supported.
198 Note! LOSS OF DATA can occur if fflush is applied on an input stream
199 that is _not_seekable_ or on an update stream that is _not_seekable_
200 and in which the most recent operation was input. Seekability can
201 be tested with lseek(fileno(fp),0,SEEK_CUR). */
202 # if @REPLACE_FFLUSH@
203 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
204 # define fflush rpl_fflush
206 _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
207 _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
209 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
211 _GL_CXXALIASWARN (fflush);
212 #elif defined GNULIB_POSIXCHECK
214 /* Assume fflush is always declared. */
215 _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
216 "use gnulib module fflush for portable POSIX compliance");
220 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
223 # define fgetc rpl_fgetc
225 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
226 _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
228 _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
230 _GL_CXXALIASWARN (fgetc);
234 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
235 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
237 # define fgets rpl_fgets
239 _GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
240 _GL_ARG_NONNULL ((1, 3)));
241 _GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
243 _GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
245 _GL_CXXALIASWARN (fgets);
250 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
252 # define fopen rpl_fopen
254 _GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
255 _GL_ARG_NONNULL ((1, 2)));
256 _GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
258 _GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
260 _GL_CXXALIASWARN (fopen);
261 #elif defined GNULIB_POSIXCHECK
263 /* Assume fopen is always declared. */
264 _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
265 "use gnulib module fopen for portability");
268 #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
269 # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
270 || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
271 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
272 # define fprintf rpl_fprintf
274 # define GNULIB_overrides_fprintf 1
275 # if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
276 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
277 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
278 _GL_ARG_NONNULL ((1, 2)));
280 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
281 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
282 _GL_ARG_NONNULL ((1, 2)));
284 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
286 _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
288 _GL_CXXALIASWARN (fprintf);
290 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
291 # if !GNULIB_overrides_fprintf
294 /* Assume fprintf is always declared. */
295 _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
296 "use gnulib module fprintf-posix for portable "
301 /* Discard all pending buffered I/O data on STREAM.
302 STREAM must not be wide-character oriented.
303 When discarding pending output, the file position is set back to where it
304 was before the write calls. When discarding pending input, the file
305 position is advanced to match the end of the previously read input.
306 Return 0 if successful. Upon error, return -1 and set errno. */
307 # if @REPLACE_FPURGE@
308 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
309 # define fpurge rpl_fpurge
311 _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
312 _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
314 # if !@HAVE_DECL_FPURGE@
315 _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
317 _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
319 _GL_CXXALIASWARN (fpurge);
320 #elif defined GNULIB_POSIXCHECK
322 # if HAVE_RAW_DECL_FPURGE
323 _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
324 "use gnulib module fpurge for portability");
329 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
330 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
332 # define fputc rpl_fputc
334 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
335 _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
337 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
339 _GL_CXXALIASWARN (fputc);
343 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
344 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
346 # define fputs rpl_fputs
348 _GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
349 _GL_ARG_NONNULL ((1, 2)));
350 _GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
352 _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
354 _GL_CXXALIASWARN (fputs);
358 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
359 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
361 # define fread rpl_fread
363 _GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
364 _GL_ARG_NONNULL ((4)));
365 _GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
367 _GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
369 _GL_CXXALIASWARN (fread);
373 # if @REPLACE_FREOPEN@
374 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
376 # define freopen rpl_freopen
378 _GL_FUNCDECL_RPL (freopen, FILE *,
379 (const char *filename, const char *mode, FILE *stream)
380 _GL_ARG_NONNULL ((2, 3)));
381 _GL_CXXALIAS_RPL (freopen, FILE *,
382 (const char *filename, const char *mode, FILE *stream));
384 _GL_CXXALIAS_SYS (freopen, FILE *,
385 (const char *filename, const char *mode, FILE *stream));
387 _GL_CXXALIASWARN (freopen);
388 #elif defined GNULIB_POSIXCHECK
390 /* Assume freopen is always declared. */
391 _GL_WARN_ON_USE (freopen,
392 "freopen on native Windows platforms is not POSIX compliant - "
393 "use gnulib module freopen for portability");
397 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
398 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
400 # define fscanf rpl_fscanf
402 _GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
403 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
404 _GL_ARG_NONNULL ((1, 2)));
405 _GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
407 _GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
409 _GL_CXXALIASWARN (fscanf);
413 /* Set up the following warnings, based on which modules are in use.
414 GNU Coding Standards discourage the use of fseek, since it imposes
415 an arbitrary limitation on some 32-bit hosts. Remember that the
416 fseek module depends on the fseeko module, so we only have three
419 1. The developer is not using either module. Issue a warning under
420 GNULIB_POSIXCHECK for both functions, to remind them that both
421 functions have bugs on some systems. _GL_NO_LARGE_FILES has no
422 impact on this warning.
424 2. The developer is using both modules. They may be unaware of the
425 arbitrary limitations of fseek, so issue a warning under
426 GNULIB_POSIXCHECK. On the other hand, they may be using both
427 modules intentionally, so the developer can define
428 _GL_NO_LARGE_FILES in the compilation units where the use of fseek
429 is safe, to silence the warning.
431 3. The developer is using the fseeko module, but not fseek. Gnulib
432 guarantees that fseek will still work around platform bugs in that
433 case, but we presume that the developer is aware of the pitfalls of
434 fseek and was trying to avoid it, so issue a warning even when
435 GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
436 defined to silence the warning in particular compilation units.
437 In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
438 fseek gets defined as a macro, it is recommended that the developer
439 uses the fseek module, even if he is not calling the fseek function.
441 Most gnulib clients that perform stream operations should fall into
445 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
446 # define _GL_FSEEK_WARN /* Category 2, above. */
450 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
452 # define fseek rpl_fseek
454 _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
455 _GL_ARG_NONNULL ((1)));
456 _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
458 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
460 _GL_CXXALIASWARN (fseek);
464 # if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
465 # define _GL_FSEEK_WARN /* Category 3, above. */
468 # if @REPLACE_FSEEKO@
469 /* Provide an fseeko function that is aware of a preceding fflush(), and which
471 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
473 # define fseeko rpl_fseeko
475 _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
476 _GL_ARG_NONNULL ((1)));
477 _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
479 # if ! @HAVE_DECL_FSEEKO@
480 _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
481 _GL_ARG_NONNULL ((1)));
483 _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
485 _GL_CXXALIASWARN (fseeko);
486 #elif defined GNULIB_POSIXCHECK
487 # define _GL_FSEEK_WARN /* Category 1, above. */
490 # if HAVE_RAW_DECL_FSEEKO
491 _GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
492 "use gnulib module fseeko for portability");
496 #ifdef _GL_FSEEK_WARN
497 # undef _GL_FSEEK_WARN
498 /* Here, either fseek is undefined (but C89 guarantees that it is
499 declared), or it is defined as rpl_fseek (declared above). */
500 _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
501 "on 32-bit platforms - "
502 "use fseeko function for handling of large files");
506 /* ftell, ftello. See the comments on fseek/fseeko. */
509 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
510 # define _GL_FTELL_WARN /* Category 2, above. */
514 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
516 # define ftell rpl_ftell
518 _GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
519 _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
521 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
523 _GL_CXXALIASWARN (ftell);
527 # if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
528 # define _GL_FTELL_WARN /* Category 3, above. */
531 # if @REPLACE_FTELLO@
532 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
534 # define ftello rpl_ftello
536 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
537 _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
539 # if ! @HAVE_DECL_FTELLO@
540 _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
542 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
544 _GL_CXXALIASWARN (ftello);
545 #elif defined GNULIB_POSIXCHECK
546 # define _GL_FTELL_WARN /* Category 1, above. */
549 # if HAVE_RAW_DECL_FTELLO
550 _GL_WARN_ON_USE (ftello, "ftello is unportable - "
551 "use gnulib module ftello for portability");
555 #ifdef _GL_FTELL_WARN
556 # undef _GL_FTELL_WARN
557 /* Here, either ftell is undefined (but C89 guarantees that it is
558 declared), or it is defined as rpl_ftell (declared above). */
559 _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
560 "on 32-bit platforms - "
561 "use ftello function for handling of large files");
566 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
567 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
569 # define fwrite rpl_fwrite
571 _GL_FUNCDECL_RPL (fwrite, size_t,
572 (const void *ptr, size_t s, size_t n, FILE *stream)
573 _GL_ARG_NONNULL ((1, 4)));
574 _GL_CXXALIAS_RPL (fwrite, size_t,
575 (const void *ptr, size_t s, size_t n, FILE *stream));
577 _GL_CXXALIAS_SYS (fwrite, size_t,
578 (const void *ptr, size_t s, size_t n, FILE *stream));
580 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
581 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
582 which sometimes causes an unwanted diagnostic for fwrite calls.
583 This affects only function declaration attributes under certain
584 versions of gcc and clang, and is not needed for C++. */
585 # if (0 < __USE_FORTIFY_LEVEL \
586 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
587 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
588 && !defined __cplusplus)
590 # undef fwrite_unlocked
591 extern size_t __REDIRECT (rpl_fwrite,
592 (const void *__restrict, size_t, size_t,
595 extern size_t __REDIRECT (rpl_fwrite_unlocked,
596 (const void *__restrict, size_t, size_t,
599 # define fwrite rpl_fwrite
600 # define fwrite_unlocked rpl_fwrite_unlocked
603 _GL_CXXALIASWARN (fwrite);
607 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
608 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
610 # define getc rpl_fgetc
612 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
613 _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
615 _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
617 _GL_CXXALIASWARN (getc);
621 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
622 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
624 # define getchar rpl_getchar
626 _GL_FUNCDECL_RPL (getchar, int, (void));
627 _GL_CXXALIAS_RPL (getchar, int, (void));
629 _GL_CXXALIAS_SYS (getchar, int, (void));
631 _GL_CXXALIASWARN (getchar);
634 #if @GNULIB_GETDELIM@
635 /* Read input, up to (and including) the next occurrence of DELIMITER, from
636 STREAM, store it in *LINEPTR (and NUL-terminate it).
637 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
638 bytes of space. It is realloc'd as necessary.
639 Return the number of bytes read and stored at *LINEPTR (not including the
640 NUL terminator), or -1 on error or EOF. */
641 # if @REPLACE_GETDELIM@
642 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
644 # define getdelim rpl_getdelim
646 _GL_FUNCDECL_RPL (getdelim, ssize_t,
647 (char **lineptr, size_t *linesize, int delimiter,
649 _GL_ARG_NONNULL ((1, 2, 4)));
650 _GL_CXXALIAS_RPL (getdelim, ssize_t,
651 (char **lineptr, size_t *linesize, int delimiter,
654 # if !@HAVE_DECL_GETDELIM@
655 _GL_FUNCDECL_SYS (getdelim, ssize_t,
656 (char **lineptr, size_t *linesize, int delimiter,
658 _GL_ARG_NONNULL ((1, 2, 4)));
660 _GL_CXXALIAS_SYS (getdelim, ssize_t,
661 (char **lineptr, size_t *linesize, int delimiter,
664 _GL_CXXALIASWARN (getdelim);
665 #elif defined GNULIB_POSIXCHECK
667 # if HAVE_RAW_DECL_GETDELIM
668 _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
669 "use gnulib module getdelim for portability");
674 /* Read a line, up to (and including) the next newline, from STREAM, store it
675 in *LINEPTR (and NUL-terminate it).
676 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
677 bytes of space. It is realloc'd as necessary.
678 Return the number of bytes read and stored at *LINEPTR (not including the
679 NUL terminator), or -1 on error or EOF. */
680 # if @REPLACE_GETLINE@
681 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
683 # define getline rpl_getline
685 _GL_FUNCDECL_RPL (getline, ssize_t,
686 (char **lineptr, size_t *linesize, FILE *stream)
687 _GL_ARG_NONNULL ((1, 2, 3)));
688 _GL_CXXALIAS_RPL (getline, ssize_t,
689 (char **lineptr, size_t *linesize, FILE *stream));
691 # if !@HAVE_DECL_GETLINE@
692 _GL_FUNCDECL_SYS (getline, ssize_t,
693 (char **lineptr, size_t *linesize, FILE *stream)
694 _GL_ARG_NONNULL ((1, 2, 3)));
696 _GL_CXXALIAS_SYS (getline, ssize_t,
697 (char **lineptr, size_t *linesize, FILE *stream));
699 # if @HAVE_DECL_GETLINE@
700 _GL_CXXALIASWARN (getline);
702 #elif defined GNULIB_POSIXCHECK
704 # if HAVE_RAW_DECL_GETLINE
705 _GL_WARN_ON_USE (getline, "getline is unportable - "
706 "use gnulib module getline for portability");
710 /* It is very rare that the developer ever has full control of stdin,
711 so any use of gets warrants an unconditional warning; besides, C11
714 #if HAVE_RAW_DECL_GETS
715 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
719 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
721 /* Grow an obstack with formatted output. Return the number of
722 bytes added to OBS. No trailing nul byte is added, and the
723 object should be closed with obstack_finish before use. Upon
724 memory allocation error, call obstack_alloc_failed_handler. Upon
725 other error, return -1. */
726 # if @REPLACE_OBSTACK_PRINTF@
727 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
728 # define obstack_printf rpl_obstack_printf
730 _GL_FUNCDECL_RPL (obstack_printf, int,
731 (struct obstack *obs, const char *format, ...)
732 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
733 _GL_ARG_NONNULL ((1, 2)));
734 _GL_CXXALIAS_RPL (obstack_printf, int,
735 (struct obstack *obs, const char *format, ...));
737 # if !@HAVE_DECL_OBSTACK_PRINTF@
738 _GL_FUNCDECL_SYS (obstack_printf, int,
739 (struct obstack *obs, const char *format, ...)
740 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
741 _GL_ARG_NONNULL ((1, 2)));
743 _GL_CXXALIAS_SYS (obstack_printf, int,
744 (struct obstack *obs, const char *format, ...));
746 _GL_CXXALIASWARN (obstack_printf);
747 # if @REPLACE_OBSTACK_PRINTF@
748 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
749 # define obstack_vprintf rpl_obstack_vprintf
751 _GL_FUNCDECL_RPL (obstack_vprintf, int,
752 (struct obstack *obs, const char *format, va_list args)
753 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
754 _GL_ARG_NONNULL ((1, 2)));
755 _GL_CXXALIAS_RPL (obstack_vprintf, int,
756 (struct obstack *obs, const char *format, va_list args));
758 # if !@HAVE_DECL_OBSTACK_PRINTF@
759 _GL_FUNCDECL_SYS (obstack_vprintf, int,
760 (struct obstack *obs, const char *format, va_list args)
761 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
762 _GL_ARG_NONNULL ((1, 2)));
764 _GL_CXXALIAS_SYS (obstack_vprintf, int,
765 (struct obstack *obs, const char *format, va_list args));
767 _GL_CXXALIASWARN (obstack_vprintf);
772 _GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
774 _GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
775 _GL_CXXALIASWARN (pclose);
776 #elif defined GNULIB_POSIXCHECK
778 # if HAVE_RAW_DECL_PCLOSE
779 _GL_WARN_ON_USE (pclose, "pclose is unportable - "
780 "use gnulib module pclose for more portability");
785 /* Print a message to standard error, describing the value of ERRNO,
786 (if STRING is not NULL and not empty) prefixed with STRING and ": ",
787 and terminated with a newline. */
788 # if @REPLACE_PERROR@
789 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
790 # define perror rpl_perror
792 _GL_FUNCDECL_RPL (perror, void, (const char *string));
793 _GL_CXXALIAS_RPL (perror, void, (const char *string));
795 _GL_CXXALIAS_SYS (perror, void, (const char *string));
797 _GL_CXXALIASWARN (perror);
798 #elif defined GNULIB_POSIXCHECK
800 /* Assume perror is always declared. */
801 _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
802 "use gnulib module perror for portability");
807 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
809 # define popen rpl_popen
811 _GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
812 _GL_ARG_NONNULL ((1, 2)));
813 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
816 _GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
817 _GL_ARG_NONNULL ((1, 2)));
819 _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
821 _GL_CXXALIASWARN (popen);
822 #elif defined GNULIB_POSIXCHECK
824 # if HAVE_RAW_DECL_POPEN
825 _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
826 "use gnulib module popen or pipe for more portability");
830 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
831 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
832 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
833 # if defined __GNUC__
834 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
835 /* Don't break __attribute__((format(printf,M,N))). */
836 # define printf __printf__
838 # if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
839 _GL_FUNCDECL_RPL_1 (__printf__, int,
840 (const char *format, ...)
841 __asm__ (@ASM_SYMBOL_PREFIX@
842 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
843 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
844 _GL_ARG_NONNULL ((1)));
846 _GL_FUNCDECL_RPL_1 (__printf__, int,
847 (const char *format, ...)
848 __asm__ (@ASM_SYMBOL_PREFIX@
849 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
850 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
851 _GL_ARG_NONNULL ((1)));
853 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
855 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
856 # define printf rpl_printf
858 _GL_FUNCDECL_RPL (printf, int,
859 (const char *format, ...)
860 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
861 _GL_ARG_NONNULL ((1)));
862 _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
864 # define GNULIB_overrides_printf 1
866 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
868 _GL_CXXALIASWARN (printf);
870 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
871 # if !GNULIB_overrides_printf
874 /* Assume printf is always declared. */
875 _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
876 "use gnulib module printf-posix for portable "
881 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
882 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
884 # define putc rpl_fputc
886 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
887 _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
889 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
891 _GL_CXXALIASWARN (putc);
895 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
896 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
898 # define putchar rpl_putchar
900 _GL_FUNCDECL_RPL (putchar, int, (int c));
901 _GL_CXXALIAS_RPL (putchar, int, (int c));
903 _GL_CXXALIAS_SYS (putchar, int, (int c));
905 _GL_CXXALIASWARN (putchar);
909 # if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
910 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
912 # define puts rpl_puts
914 _GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
915 _GL_CXXALIAS_RPL (puts, int, (const char *string));
917 _GL_CXXALIAS_SYS (puts, int, (const char *string));
919 _GL_CXXALIASWARN (puts);
923 # if @REPLACE_REMOVE@
924 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
926 # define remove rpl_remove
928 _GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
929 _GL_CXXALIAS_RPL (remove, int, (const char *name));
931 _GL_CXXALIAS_SYS (remove, int, (const char *name));
933 _GL_CXXALIASWARN (remove);
934 #elif defined GNULIB_POSIXCHECK
936 /* Assume remove is always declared. */
937 _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
938 "use gnulib module remove for more portability");
942 # if @REPLACE_RENAME@
943 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
945 # define rename rpl_rename
947 _GL_FUNCDECL_RPL (rename, int,
948 (const char *old_filename, const char *new_filename)
949 _GL_ARG_NONNULL ((1, 2)));
950 _GL_CXXALIAS_RPL (rename, int,
951 (const char *old_filename, const char *new_filename));
953 _GL_CXXALIAS_SYS (rename, int,
954 (const char *old_filename, const char *new_filename));
956 _GL_CXXALIASWARN (rename);
957 #elif defined GNULIB_POSIXCHECK
959 /* Assume rename is always declared. */
960 _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
961 "use gnulib module rename for more portability");
964 #if @GNULIB_RENAMEAT@
965 # if @REPLACE_RENAMEAT@
966 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
968 # define renameat rpl_renameat
970 _GL_FUNCDECL_RPL (renameat, int,
971 (int fd1, char const *file1, int fd2, char const *file2)
972 _GL_ARG_NONNULL ((2, 4)));
973 _GL_CXXALIAS_RPL (renameat, int,
974 (int fd1, char const *file1, int fd2, char const *file2));
976 # if !@HAVE_RENAMEAT@
977 _GL_FUNCDECL_SYS (renameat, int,
978 (int fd1, char const *file1, int fd2, char const *file2)
979 _GL_ARG_NONNULL ((2, 4)));
981 _GL_CXXALIAS_SYS (renameat, int,
982 (int fd1, char const *file1, int fd2, char const *file2));
984 _GL_CXXALIASWARN (renameat);
985 #elif defined GNULIB_POSIXCHECK
987 # if HAVE_RAW_DECL_RENAMEAT
988 _GL_WARN_ON_USE (renameat, "renameat is not portable - "
989 "use gnulib module renameat for portability");
994 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
995 # if defined __GNUC__
996 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
998 /* Don't break __attribute__((format(scanf,M,N))). */
999 # define scanf __scanf__
1001 _GL_FUNCDECL_RPL_1 (__scanf__, int,
1002 (const char *format, ...)
1003 __asm__ (@ASM_SYMBOL_PREFIX@
1004 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
1005 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1006 _GL_ARG_NONNULL ((1)));
1007 _GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
1009 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1011 # define scanf rpl_scanf
1013 _GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
1014 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1015 _GL_ARG_NONNULL ((1)));
1016 _GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
1019 _GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
1021 _GL_CXXALIASWARN (scanf);
1024 #if @GNULIB_SNPRINTF@
1025 # if @REPLACE_SNPRINTF@
1026 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1027 # define snprintf rpl_snprintf
1029 _GL_FUNCDECL_RPL (snprintf, int,
1030 (char *str, size_t size, const char *format, ...)
1031 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1032 _GL_ARG_NONNULL ((3)));
1033 _GL_CXXALIAS_RPL (snprintf, int,
1034 (char *str, size_t size, const char *format, ...));
1036 # if !@HAVE_DECL_SNPRINTF@
1037 _GL_FUNCDECL_SYS (snprintf, int,
1038 (char *str, size_t size, const char *format, ...)
1039 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1040 _GL_ARG_NONNULL ((3)));
1042 _GL_CXXALIAS_SYS (snprintf, int,
1043 (char *str, size_t size, const char *format, ...));
1045 _GL_CXXALIASWARN (snprintf);
1046 #elif defined GNULIB_POSIXCHECK
1048 # if HAVE_RAW_DECL_SNPRINTF
1049 _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1050 "use gnulib module snprintf for portability");
1054 /* Some people would argue that all sprintf uses should be warned about
1055 (for example, OpenBSD issues a link warning for it),
1056 since it can cause security holes due to buffer overruns.
1057 However, we believe that sprintf can be used safely, and is more
1058 efficient than snprintf in those safe cases; and as proof of our
1059 belief, we use sprintf in several gnulib modules. So this header
1060 intentionally avoids adding a warning to sprintf except when
1061 GNULIB_POSIXCHECK is defined. */
1063 #if @GNULIB_SPRINTF_POSIX@
1064 # if @REPLACE_SPRINTF@
1065 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1066 # define sprintf rpl_sprintf
1068 _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
1069 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1070 _GL_ARG_NONNULL ((1, 2)));
1071 _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
1073 _GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
1075 _GL_CXXALIASWARN (sprintf);
1076 #elif defined GNULIB_POSIXCHECK
1078 /* Assume sprintf is always declared. */
1079 _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
1080 "use gnulib module sprintf-posix for portable "
1081 "POSIX compliance");
1084 #if @GNULIB_TMPFILE@
1085 # if @REPLACE_TMPFILE@
1086 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1087 # define tmpfile rpl_tmpfile
1089 _GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
1090 _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
1092 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
1094 _GL_CXXALIASWARN (tmpfile);
1095 #elif defined GNULIB_POSIXCHECK
1097 # if HAVE_RAW_DECL_TMPFILE
1098 _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
1099 "use gnulib module tmpfile for portability");
1103 #if @GNULIB_VASPRINTF@
1104 /* Write formatted output to a string dynamically allocated with malloc().
1105 If the memory allocation succeeds, store the address of the string in
1106 *RESULT and return the number of resulting bytes, excluding the trailing
1107 NUL. Upon memory allocation error, or some other error, return -1. */
1108 # if @REPLACE_VASPRINTF@
1109 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1110 # define asprintf rpl_asprintf
1112 _GL_FUNCDECL_RPL (asprintf, int,
1113 (char **result, const char *format, ...)
1114 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1115 _GL_ARG_NONNULL ((1, 2)));
1116 _GL_CXXALIAS_RPL (asprintf, int,
1117 (char **result, const char *format, ...));
1119 # if !@HAVE_VASPRINTF@
1120 _GL_FUNCDECL_SYS (asprintf, int,
1121 (char **result, const char *format, ...)
1122 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1123 _GL_ARG_NONNULL ((1, 2)));
1125 _GL_CXXALIAS_SYS (asprintf, int,
1126 (char **result, const char *format, ...));
1128 _GL_CXXALIASWARN (asprintf);
1129 # if @REPLACE_VASPRINTF@
1130 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1131 # define vasprintf rpl_vasprintf
1133 _GL_FUNCDECL_RPL (vasprintf, int,
1134 (char **result, const char *format, va_list args)
1135 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1136 _GL_ARG_NONNULL ((1, 2)));
1137 _GL_CXXALIAS_RPL (vasprintf, int,
1138 (char **result, const char *format, va_list args));
1140 # if !@HAVE_VASPRINTF@
1141 _GL_FUNCDECL_SYS (vasprintf, int,
1142 (char **result, const char *format, va_list args)
1143 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1144 _GL_ARG_NONNULL ((1, 2)));
1146 _GL_CXXALIAS_SYS (vasprintf, int,
1147 (char **result, const char *format, va_list args));
1149 _GL_CXXALIASWARN (vasprintf);
1152 #if @GNULIB_VDPRINTF@
1153 # if @REPLACE_VDPRINTF@
1154 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1155 # define vdprintf rpl_vdprintf
1157 _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
1158 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1159 _GL_ARG_NONNULL ((2)));
1160 _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
1162 # if !@HAVE_VDPRINTF@
1163 _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
1164 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1165 _GL_ARG_NONNULL ((2)));
1167 /* Need to cast, because on Solaris, the third parameter will likely be
1169 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
1170 (int fd, const char *format, va_list args));
1172 _GL_CXXALIASWARN (vdprintf);
1173 #elif defined GNULIB_POSIXCHECK
1175 # if HAVE_RAW_DECL_VDPRINTF
1176 _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
1177 "use gnulib module vdprintf for portability");
1181 #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
1182 # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
1183 || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1184 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1185 # define vfprintf rpl_vfprintf
1187 # define GNULIB_overrides_vfprintf 1
1188 # if @GNULIB_VFPRINTF_POSIX@
1189 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
1190 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1191 _GL_ARG_NONNULL ((1, 2)));
1193 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
1194 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
1195 _GL_ARG_NONNULL ((1, 2)));
1197 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
1199 /* Need to cast, because on Solaris, the third parameter is
1201 and GCC's fixincludes did not change this to __gnuc_va_list. */
1202 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
1203 (FILE *fp, const char *format, va_list args));
1205 _GL_CXXALIASWARN (vfprintf);
1207 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1208 # if !GNULIB_overrides_vfprintf
1211 /* Assume vfprintf is always declared. */
1212 _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
1213 "use gnulib module vfprintf-posix for portable "
1214 "POSIX compliance");
1217 #if @GNULIB_VFSCANF@
1218 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1219 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1221 # define vfscanf rpl_vfscanf
1223 _GL_FUNCDECL_RPL (vfscanf, int,
1224 (FILE *stream, const char *format, va_list args)
1225 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
1226 _GL_ARG_NONNULL ((1, 2)));
1227 _GL_CXXALIAS_RPL (vfscanf, int,
1228 (FILE *stream, const char *format, va_list args));
1230 _GL_CXXALIAS_SYS (vfscanf, int,
1231 (FILE *stream, const char *format, va_list args));
1233 _GL_CXXALIASWARN (vfscanf);
1236 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
1237 # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
1238 || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1239 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1240 # define vprintf rpl_vprintf
1242 # define GNULIB_overrides_vprintf 1
1243 # if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
1244 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
1245 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
1246 _GL_ARG_NONNULL ((1)));
1248 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
1249 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
1250 _GL_ARG_NONNULL ((1)));
1252 _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
1254 /* Need to cast, because on Solaris, the second parameter is
1256 and GCC's fixincludes did not change this to __gnuc_va_list. */
1257 _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
1259 _GL_CXXALIASWARN (vprintf);
1261 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
1262 # if !GNULIB_overrides_vprintf
1265 /* Assume vprintf is always declared. */
1266 _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
1267 "use gnulib module vprintf-posix for portable "
1268 "POSIX compliance");
1272 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1273 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1275 # define vscanf rpl_vscanf
1277 _GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
1278 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
1279 _GL_ARG_NONNULL ((1)));
1280 _GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
1282 _GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
1284 _GL_CXXALIASWARN (vscanf);
1287 #if @GNULIB_VSNPRINTF@
1288 # if @REPLACE_VSNPRINTF@
1289 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1290 # define vsnprintf rpl_vsnprintf
1292 _GL_FUNCDECL_RPL (vsnprintf, int,
1293 (char *str, size_t size, const char *format, va_list args)
1294 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1295 _GL_ARG_NONNULL ((3)));
1296 _GL_CXXALIAS_RPL (vsnprintf, int,
1297 (char *str, size_t size, const char *format, va_list args));
1299 # if !@HAVE_DECL_VSNPRINTF@
1300 _GL_FUNCDECL_SYS (vsnprintf, int,
1301 (char *str, size_t size, const char *format, va_list args)
1302 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1303 _GL_ARG_NONNULL ((3)));
1305 _GL_CXXALIAS_SYS (vsnprintf, int,
1306 (char *str, size_t size, const char *format, va_list args));
1308 _GL_CXXALIASWARN (vsnprintf);
1309 #elif defined GNULIB_POSIXCHECK
1311 # if HAVE_RAW_DECL_VSNPRINTF
1312 _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1313 "use gnulib module vsnprintf for portability");
1317 #if @GNULIB_VSPRINTF_POSIX@
1318 # if @REPLACE_VSPRINTF@
1319 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1320 # define vsprintf rpl_vsprintf
1322 _GL_FUNCDECL_RPL (vsprintf, int,
1323 (char *str, const char *format, va_list args)
1324 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1325 _GL_ARG_NONNULL ((1, 2)));
1326 _GL_CXXALIAS_RPL (vsprintf, int,
1327 (char *str, const char *format, va_list args));
1329 /* Need to cast, because on Solaris, the third parameter is
1331 and GCC's fixincludes did not change this to __gnuc_va_list. */
1332 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
1333 (char *str, const char *format, va_list args));
1335 _GL_CXXALIASWARN (vsprintf);
1336 #elif defined GNULIB_POSIXCHECK
1338 /* Assume vsprintf is always declared. */
1339 _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
1340 "use gnulib module vsprintf-posix for portable "
1341 "POSIX compliance");
1344 #endif /* _@GUARD_PREFIX@_STDIO_H */
1345 #endif /* _@GUARD_PREFIX@_STDIO_H */