1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <stdio.h>.
4 Copyright (C) 2004, 2007-2019 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <https://www.gnu.org/licenses/>. */
20 #pragma GCC system_header
24 #if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
25 /* Special invocation convention:
26 - Inside glibc header files.
27 - On OSF/1 5.1 we have a sequence of nested includes
28 <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
29 <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
30 In this situation, the functions are not yet declared, therefore we cannot
31 provide the C++ aliases. */
33 #include_next <stdio.h>
36 /* Normal invocation convention. */
40 #define _GL_ALREADY_INCLUDING_STDIO_H
42 /* The include_next requires a split double-inclusion guard. */
43 #include_next <stdio.h>
45 #undef _GL_ALREADY_INCLUDING_STDIO_H
50 /* Get va_list. Needed on many systems, including glibc 2.8. */
55 /* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
57 May also define off_t to a 64-bit type on native Windows. */
58 #include <sys/types.h>
60 /* The __attribute__ feature is available in gcc versions 2.5 and later.
61 The __-protected variants of the attributes 'format' and 'printf' are
62 accepted by gcc versions 2.6.4 (effectively 2.7) and later.
63 We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
64 gnulib and libintl do '#define printf __printf__' when they override
65 the 'printf' function. */
66 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
67 # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
69 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
72 /* _GL_ATTRIBUTE_FORMAT_PRINTF
73 indicates to GCC that the function takes a format string and arguments,
74 where the format string directives are the ones standardized by ISO C99
76 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
77 # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
78 _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
80 # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
81 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
84 /* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
85 except that it indicates to GCC that the supported format string directives
86 are the ones of the system printf(), rather than the ones standardized by
88 #if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
89 # define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
90 _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
92 # define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
93 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
96 /* _GL_ATTRIBUTE_FORMAT_SCANF
97 indicates to GCC that the function takes a format string and arguments,
98 where the format string directives are the ones standardized by ISO C99
100 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
101 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
102 _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
104 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
105 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
108 /* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
109 except that it indicates to GCC that the supported format string directives
110 are the ones of the system scanf(), rather than the ones standardized by
111 ISO C99 and POSIX. */
112 #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
113 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
115 /* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>. */
116 /* But in any case avoid namespace pollution on glibc systems. */
117 #if (0 || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
118 && ! defined __GLIBC__
122 /* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include
123 it before we #define perror rpl_perror. */
124 /* But in any case avoid namespace pollution on glibc systems. */
125 #if (0 || defined GNULIB_POSIXCHECK) \
126 && (defined _WIN32 && ! defined __CYGWIN__) \
127 && ! defined __GLIBC__
131 /* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include
132 it before we #define remove rpl_remove. */
133 /* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include
134 it before we #define rename rpl_rename. */
135 /* But in any case avoid namespace pollution on glibc systems. */
136 #if (0 || 1 || defined GNULIB_POSIXCHECK) \
137 && (defined _WIN32 && ! defined __CYGWIN__) \
138 && ! defined __GLIBC__
143 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
144 /* C++ compatible function declaration macros.
145 Copyright (C) 2010-2019 Free Software Foundation, Inc.
147 This program is free software: you can redistribute it and/or modify it
148 under the terms of the GNU General Public License as published
149 by the Free Software Foundation; either version 3 of the License, or
150 (at your option) any later version.
152 This program is distributed in the hope that it will be useful,
153 but WITHOUT ANY WARRANTY; without even the implied warranty of
154 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
155 General Public License for more details.
157 You should have received a copy of the GNU General Public License
158 along with this program. If not, see <https://www.gnu.org/licenses/>. */
160 #ifndef _GL_CXXDEFS_H
161 #define _GL_CXXDEFS_H
163 /* Begin/end the GNULIB_NAMESPACE namespace. */
164 #if defined __cplusplus && defined GNULIB_NAMESPACE
165 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
166 # define _GL_END_NAMESPACE }
168 # define _GL_BEGIN_NAMESPACE
169 # define _GL_END_NAMESPACE
172 /* The three most frequent use cases of these macros are:
174 * For providing a substitute for a function that is missing on some
175 platforms, but is declared and works fine on the platforms on which
180 _GL_FUNCDECL_SYS (foo, ...);
182 _GL_CXXALIAS_SYS (foo, ...);
183 _GL_CXXALIASWARN (foo);
184 #elif defined GNULIB_POSIXCHECK
188 * For providing a replacement for a function that exists on all platforms,
189 but is broken/insufficient and needs to be replaced on some platforms:
193 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
197 _GL_FUNCDECL_RPL (foo, ...);
198 _GL_CXXALIAS_RPL (foo, ...);
200 _GL_CXXALIAS_SYS (foo, ...);
202 _GL_CXXALIASWARN (foo);
203 #elif defined GNULIB_POSIXCHECK
207 * For providing a replacement for a function that exists on some platforms
208 but is broken/insufficient and needs to be replaced on some of them and
209 is additionally either missing or undeclared on some other platforms:
213 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
217 _GL_FUNCDECL_RPL (foo, ...);
218 _GL_CXXALIAS_RPL (foo, ...);
220 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
221 _GL_FUNCDECL_SYS (foo, ...);
223 _GL_CXXALIAS_SYS (foo, ...);
225 _GL_CXXALIASWARN (foo);
226 #elif defined GNULIB_POSIXCHECK
231 /* _GL_EXTERN_C declaration;
232 performs the declaration with C linkage. */
233 #if defined __cplusplus
234 # define _GL_EXTERN_C extern "C"
236 # define _GL_EXTERN_C extern
239 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
240 declares a replacement function, named rpl_func, with the given prototype,
241 consisting of return type, parameters, and attributes.
243 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
244 _GL_ARG_NONNULL ((1)));
246 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
247 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
248 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
249 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
251 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
252 declares the system function, named func, with the given prototype,
253 consisting of return type, parameters, and attributes.
255 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
256 _GL_ARG_NONNULL ((1)));
258 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
259 _GL_EXTERN_C rettype func parameters_and_attributes
261 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
262 declares a C++ alias called GNULIB_NAMESPACE::func
263 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
265 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
267 Wrapping rpl_func in an object with an inline conversion operator
268 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
269 actually used in the program. */
270 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
271 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
272 #if defined __cplusplus && defined GNULIB_NAMESPACE
273 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
274 namespace GNULIB_NAMESPACE \
276 static const struct _gl_ ## func ## _wrapper \
278 typedef rettype (*type) parameters; \
280 inline operator type () const \
286 _GL_EXTERN_C int _gl_cxxalias_dummy
288 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
289 _GL_EXTERN_C int _gl_cxxalias_dummy
292 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
293 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
294 except that the C function rpl_func may have a slightly different
295 declaration. A cast is used to silence the "invalid conversion" error
296 that would otherwise occur. */
297 #if defined __cplusplus && defined GNULIB_NAMESPACE
298 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
299 namespace GNULIB_NAMESPACE \
301 static const struct _gl_ ## func ## _wrapper \
303 typedef rettype (*type) parameters; \
305 inline operator type () const \
307 return reinterpret_cast<type>(::rpl_func); \
311 _GL_EXTERN_C int _gl_cxxalias_dummy
313 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
314 _GL_EXTERN_C int _gl_cxxalias_dummy
317 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
318 declares a C++ alias called GNULIB_NAMESPACE::func
319 that redirects to the system provided function func, if GNULIB_NAMESPACE
322 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
324 Wrapping func in an object with an inline conversion operator
325 avoids a reference to func unless GNULIB_NAMESPACE::func is
326 actually used in the program. */
327 #if defined __cplusplus && defined GNULIB_NAMESPACE
328 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
329 namespace GNULIB_NAMESPACE \
331 static const struct _gl_ ## func ## _wrapper \
333 typedef rettype (*type) parameters; \
335 inline operator type () const \
341 _GL_EXTERN_C int _gl_cxxalias_dummy
343 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
344 _GL_EXTERN_C int _gl_cxxalias_dummy
347 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
348 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
349 except that the C function func may have a slightly different declaration.
350 A cast is used to silence the "invalid conversion" error that would
352 #if defined __cplusplus && defined GNULIB_NAMESPACE
353 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
354 namespace GNULIB_NAMESPACE \
356 static const struct _gl_ ## func ## _wrapper \
358 typedef rettype (*type) parameters; \
360 inline operator type () const \
362 return reinterpret_cast<type>(::func); \
366 _GL_EXTERN_C int _gl_cxxalias_dummy
368 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
369 _GL_EXTERN_C int _gl_cxxalias_dummy
372 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
373 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
374 except that the C function is picked among a set of overloaded functions,
375 namely the one with rettype2 and parameters2. Two consecutive casts
376 are used to silence the "cannot find a match" and "invalid conversion"
377 errors that would otherwise occur. */
378 #if defined __cplusplus && defined GNULIB_NAMESPACE
379 /* The outer cast must be a reinterpret_cast.
380 The inner cast: When the function is defined as a set of overloaded
381 functions, it works as a static_cast<>, choosing the designated variant.
382 When the function is defined as a single variant, it works as a
383 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
384 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
385 namespace GNULIB_NAMESPACE \
387 static const struct _gl_ ## func ## _wrapper \
389 typedef rettype (*type) parameters; \
391 inline operator type () const \
393 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
397 _GL_EXTERN_C int _gl_cxxalias_dummy
399 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
400 _GL_EXTERN_C int _gl_cxxalias_dummy
403 /* _GL_CXXALIASWARN (func);
404 causes a warning to be emitted when ::func is used but not when
405 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
407 #if defined __cplusplus && defined GNULIB_NAMESPACE
408 # define _GL_CXXALIASWARN(func) \
409 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
410 # define _GL_CXXALIASWARN_1(func,namespace) \
411 _GL_CXXALIASWARN_2 (func, namespace)
412 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
413 we enable the warning only when not optimizing. */
415 # define _GL_CXXALIASWARN_2(func,namespace) \
416 _GL_WARN_ON_USE (func, \
417 "The symbol ::" #func " refers to the system function. " \
418 "Use " #namespace "::" #func " instead.")
419 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
420 # define _GL_CXXALIASWARN_2(func,namespace) \
421 extern __typeof__ (func) func
423 # define _GL_CXXALIASWARN_2(func,namespace) \
424 _GL_EXTERN_C int _gl_cxxalias_dummy
427 # define _GL_CXXALIASWARN(func) \
428 _GL_EXTERN_C int _gl_cxxalias_dummy
431 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
432 causes a warning to be emitted when the given overloaded variant of ::func
433 is used but not when GNULIB_NAMESPACE::func is used. */
434 #if defined __cplusplus && defined GNULIB_NAMESPACE
435 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
436 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
438 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
439 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
440 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
441 we enable the warning only when not optimizing. */
443 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
444 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
445 "The symbol ::" #func " refers to the system function. " \
446 "Use " #namespace "::" #func " instead.")
447 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
448 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
449 extern __typeof__ (func) func
451 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
452 _GL_EXTERN_C int _gl_cxxalias_dummy
455 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
456 _GL_EXTERN_C int _gl_cxxalias_dummy
459 #endif /* _GL_CXXDEFS_H */
461 /* The definition of _GL_ARG_NONNULL is copied here. */
462 /* A C macro for declaring that specific arguments must not be NULL.
463 Copyright (C) 2009-2019 Free Software Foundation, Inc.
465 This program is free software: you can redistribute it and/or modify it
466 under the terms of the GNU General Public License as published
467 by the Free Software Foundation; either version 3 of the License, or
468 (at your option) any later version.
470 This program is distributed in the hope that it will be useful,
471 but WITHOUT ANY WARRANTY; without even the implied warranty of
472 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
473 General Public License for more details.
475 You should have received a copy of the GNU General Public License
476 along with this program. If not, see <https://www.gnu.org/licenses/>. */
478 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
479 that the values passed as arguments n, ..., m must be non-NULL pointers.
480 n = 1 stands for the first argument, n = 2 for the second argument etc. */
481 #ifndef _GL_ARG_NONNULL
482 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
483 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
485 # define _GL_ARG_NONNULL(params)
489 /* The definition of _GL_WARN_ON_USE is copied here. */
490 /* A C macro for emitting warnings if a function is used.
491 Copyright (C) 2010-2019 Free Software Foundation, Inc.
493 This program is free software: you can redistribute it and/or modify it
494 under the terms of the GNU General Public License as published
495 by the Free Software Foundation; either version 3 of the License, or
496 (at your option) any later version.
498 This program is distributed in the hope that it will be useful,
499 but WITHOUT ANY WARRANTY; without even the implied warranty of
500 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
501 General Public License for more details.
503 You should have received a copy of the GNU General Public License
504 along with this program. If not, see <https://www.gnu.org/licenses/>. */
506 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
507 for FUNCTION which will then trigger a compiler warning containing
508 the text of "literal string" anywhere that function is called, if
509 supported by the compiler. If the compiler does not support this
510 feature, the macro expands to an unused extern declaration.
512 _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
513 attribute used in _GL_WARN_ON_USE. If the compiler does not support
514 this feature, it expands to empty.
516 These macros are useful for marking a function as a potential
517 portability trap, with the intent that "literal string" include
518 instructions on the replacement function that should be used
520 _GL_WARN_ON_USE is for functions with 'extern' linkage.
521 _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
524 However, one of the reasons that a function is a portability trap is
525 if it has the wrong signature. Declaring FUNCTION with a different
526 signature in C is a compilation error, so this macro must use the
527 same type as any existing declaration so that programs that avoid
528 the problematic FUNCTION do not fail to compile merely because they
529 included a header that poisoned the function. But this implies that
530 _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
531 have a declaration. Use of this macro implies that there must not
532 be any other macro hiding the declaration of FUNCTION; but
533 undefining FUNCTION first is part of the poisoning process anyway
534 (although for symbols that are provided only via a macro, the result
535 is a compilation error rather than a warning containing
536 "literal string"). Also note that in C++, it is only safe to use if
537 FUNCTION has no overloads.
539 For an example, it is possible to poison 'getline' by:
540 - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
541 [getline]) in configure.ac, which potentially defines
542 HAVE_RAW_DECL_GETLINE
543 - adding this code to a header that wraps the system <stdio.h>:
545 #if HAVE_RAW_DECL_GETLINE
546 _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
547 "not universally present; use the gnulib module getline");
550 It is not possible to directly poison global variables. But it is
551 possible to write a wrapper accessor function, and poison that
552 (less common usage, like &environ, will cause a compilation error
553 rather than issue the nice warning, but the end result of informing
554 the developer about their portability problem is still achieved):
555 #if HAVE_RAW_DECL_ENVIRON
557 rpl_environ (void) { return &environ; }
558 _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
560 # define environ (*rpl_environ ())
562 or better (avoiding contradictory use of 'static' and 'extern'):
563 #if HAVE_RAW_DECL_ENVIRON
565 _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
566 rpl_environ (void) { return &environ; }
568 # define environ (*rpl_environ ())
571 #ifndef _GL_WARN_ON_USE
573 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
574 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
575 # define _GL_WARN_ON_USE(function, message) \
576 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
577 # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
578 __attribute__ ((__warning__ (message)))
579 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
580 /* Verify the existence of the function. */
581 # define _GL_WARN_ON_USE(function, message) \
582 extern __typeof__ (function) function
583 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
584 # else /* Unsupported. */
585 # define _GL_WARN_ON_USE(function, message) \
586 _GL_WARN_EXTERN_C int _gl_warn_on_use
587 # define _GL_WARN_ON_USE_ATTRIBUTE(message)
591 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
592 is like _GL_WARN_ON_USE (function, "string"), except that the function is
593 declared with the given prototype, consisting of return type, parameters,
595 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
596 not work in this case. */
597 #ifndef _GL_WARN_ON_USE_CXX
598 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
599 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
600 extern rettype function parameters_and_attributes \
601 __attribute__ ((__warning__ (msg)))
602 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
603 /* Verify the existence of the function. */
604 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
605 extern rettype function parameters_and_attributes
606 # else /* Unsupported. */
607 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
608 _GL_WARN_EXTERN_C int _gl_warn_on_use
612 /* _GL_WARN_EXTERN_C declaration;
613 performs the declaration with C linkage. */
614 #ifndef _GL_WARN_EXTERN_C
615 # if defined __cplusplus
616 # define _GL_WARN_EXTERN_C extern "C"
618 # define _GL_WARN_EXTERN_C extern
622 /* Macros for stringification. */
623 #define _GL_STDIO_STRINGIZE(token) #token
624 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
626 /* When also using extern inline, suppress the use of static inline in
627 standard headers of problematic Apple configurations, as Libc at
628 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
629 <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
630 Perhaps Apple will fix this some day. */
631 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
632 && defined __GNUC__ && defined __STDC__)
633 # undef putc_unlocked
638 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
639 # define dprintf rpl_dprintf
641 _GL_FUNCDECL_RPL (dprintf
, int, (int fd
, const char *format
, ...)
642 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
643 _GL_ARG_NONNULL ((2)));
644 _GL_CXXALIAS_RPL (dprintf
, int, (int fd
, const char *format
, ...));
647 _GL_FUNCDECL_SYS (dprintf
, int, (int fd
, const char *format
, ...)
648 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
649 _GL_ARG_NONNULL ((2)));
651 _GL_CXXALIAS_SYS (dprintf
, int, (int fd
, const char *format
, ...));
653 _GL_CXXALIASWARN (dprintf
);
654 #elif defined GNULIB_POSIXCHECK
656 # if HAVE_RAW_DECL_DPRINTF
657 _GL_WARN_ON_USE (dprintf
, "dprintf is unportable - "
658 "use gnulib module dprintf for portability");
663 /* Close STREAM and its underlying file descriptor. */
665 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
666 # define fclose rpl_fclose
668 _GL_FUNCDECL_RPL (fclose
, int, (FILE *stream
) _GL_ARG_NONNULL ((1)));
669 _GL_CXXALIAS_RPL (fclose
, int, (FILE *stream
));
671 _GL_CXXALIAS_SYS (fclose
, int, (FILE *stream
));
673 _GL_CXXALIASWARN (fclose
);
674 #elif defined GNULIB_POSIXCHECK
676 /* Assume fclose is always declared. */
677 _GL_WARN_ON_USE (fclose
, "fclose is not always POSIX compliant - "
678 "use gnulib module fclose for portable POSIX compliance");
683 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
685 # define fdopen rpl_fdopen
687 _GL_FUNCDECL_RPL (fdopen
, FILE *, (int fd
, const char *mode
)
688 _GL_ARG_NONNULL ((2)));
689 _GL_CXXALIAS_RPL (fdopen
, FILE *, (int fd
, const char *mode
));
691 _GL_CXXALIAS_SYS (fdopen
, FILE *, (int fd
, const char *mode
));
693 _GL_CXXALIASWARN (fdopen
);
694 #elif defined GNULIB_POSIXCHECK
696 /* Assume fdopen is always declared. */
697 _GL_WARN_ON_USE (fdopen
, "fdopen on native Windows platforms is not POSIX compliant - "
698 "use gnulib module fdopen for portability");
702 /* Flush all pending data on STREAM according to POSIX rules. Both
703 output and seekable input streams are supported.
704 Note! LOSS OF DATA can occur if fflush is applied on an input stream
705 that is _not_seekable_ or on an update stream that is _not_seekable_
706 and in which the most recent operation was input. Seekability can
707 be tested with lseek(fileno(fp),0,SEEK_CUR). */
709 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
710 # define fflush rpl_fflush
712 _GL_FUNCDECL_RPL (fflush
, int, (FILE *gl_stream
));
713 _GL_CXXALIAS_RPL (fflush
, int, (FILE *gl_stream
));
715 _GL_CXXALIAS_SYS (fflush
, int, (FILE *gl_stream
));
717 _GL_CXXALIASWARN (fflush
);
718 #elif defined GNULIB_POSIXCHECK
720 /* Assume fflush is always declared. */
721 _GL_WARN_ON_USE (fflush
, "fflush is not always POSIX compliant - "
722 "use gnulib module fflush for portable POSIX compliance");
727 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
729 # define fgetc rpl_fgetc
731 _GL_FUNCDECL_RPL (fgetc
, int, (FILE *stream
) _GL_ARG_NONNULL ((1)));
732 _GL_CXXALIAS_RPL (fgetc
, int, (FILE *stream
));
734 _GL_CXXALIAS_SYS (fgetc
, int, (FILE *stream
));
736 _GL_CXXALIASWARN (fgetc
);
741 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
743 # define fgets rpl_fgets
745 _GL_FUNCDECL_RPL (fgets
, char *, (char *s
, int n
, FILE *stream
)
746 _GL_ARG_NONNULL ((1, 3)));
747 _GL_CXXALIAS_RPL (fgets
, char *, (char *s
, int n
, FILE *stream
));
749 _GL_CXXALIAS_SYS (fgets
, char *, (char *s
, int n
, FILE *stream
));
751 _GL_CXXALIASWARN (fgets
);
756 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
758 # define fopen rpl_fopen
760 _GL_FUNCDECL_RPL (fopen
, FILE *, (const char *filename
, const char *mode
)
761 _GL_ARG_NONNULL ((1, 2)));
762 _GL_CXXALIAS_RPL (fopen
, FILE *, (const char *filename
, const char *mode
));
764 _GL_CXXALIAS_SYS (fopen
, FILE *, (const char *filename
, const char *mode
));
766 _GL_CXXALIASWARN (fopen
);
767 #elif defined GNULIB_POSIXCHECK
769 /* Assume fopen is always declared. */
770 _GL_WARN_ON_USE (fopen
, "fopen on native Windows platforms is not POSIX compliant - "
771 "use gnulib module fopen for portability");
776 || (1 && 0 && (0 || 0))
777 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
778 # define fprintf rpl_fprintf
780 # define GNULIB_overrides_fprintf 1
782 _GL_FUNCDECL_RPL (fprintf
, int, (FILE *fp
, const char *format
, ...)
783 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
784 _GL_ARG_NONNULL ((1, 2)));
786 _GL_FUNCDECL_RPL (fprintf
, int, (FILE *fp
, const char *format
, ...)
787 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
788 _GL_ARG_NONNULL ((1, 2)));
790 _GL_CXXALIAS_RPL (fprintf
, int, (FILE *fp
, const char *format
, ...));
792 _GL_CXXALIAS_SYS (fprintf
, int, (FILE *fp
, const char *format
, ...));
794 _GL_CXXALIASWARN (fprintf
);
796 #if !1 && defined GNULIB_POSIXCHECK
797 # if !GNULIB_overrides_fprintf
800 /* Assume fprintf is always declared. */
801 _GL_WARN_ON_USE (fprintf
, "fprintf is not always POSIX compliant - "
802 "use gnulib module fprintf-posix for portable "
807 /* Discard all pending buffered I/O data on STREAM.
808 STREAM must not be wide-character oriented.
809 When discarding pending output, the file position is set back to where it
810 was before the write calls. When discarding pending input, the file
811 position is advanced to match the end of the previously read input.
812 Return 0 if successful. Upon error, return -1 and set errno. */
814 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
815 # define fpurge rpl_fpurge
817 _GL_FUNCDECL_RPL (fpurge
, int, (FILE *gl_stream
) _GL_ARG_NONNULL ((1)));
818 _GL_CXXALIAS_RPL (fpurge
, int, (FILE *gl_stream
));
821 _GL_FUNCDECL_SYS (fpurge
, int, (FILE *gl_stream
) _GL_ARG_NONNULL ((1)));
823 _GL_CXXALIAS_SYS (fpurge
, int, (FILE *gl_stream
));
825 _GL_CXXALIASWARN (fpurge
);
826 #elif defined GNULIB_POSIXCHECK
828 # if HAVE_RAW_DECL_FPURGE
829 _GL_WARN_ON_USE (fpurge
, "fpurge is not always present - "
830 "use gnulib module fpurge for portability");
836 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
838 # define fputc rpl_fputc
840 _GL_FUNCDECL_RPL (fputc
, int, (int c
, FILE *stream
) _GL_ARG_NONNULL ((2)));
841 _GL_CXXALIAS_RPL (fputc
, int, (int c
, FILE *stream
));
843 _GL_CXXALIAS_SYS (fputc
, int, (int c
, FILE *stream
));
845 _GL_CXXALIASWARN (fputc
);
850 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
852 # define fputs rpl_fputs
854 _GL_FUNCDECL_RPL (fputs
, int, (const char *string
, FILE *stream
)
855 _GL_ARG_NONNULL ((1, 2)));
856 _GL_CXXALIAS_RPL (fputs
, int, (const char *string
, FILE *stream
));
858 _GL_CXXALIAS_SYS (fputs
, int, (const char *string
, FILE *stream
));
860 _GL_CXXALIASWARN (fputs
);
865 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
867 # define fread rpl_fread
869 _GL_FUNCDECL_RPL (fread
, size_t, (void *ptr
, size_t s
, size_t n
, FILE *stream
)
870 _GL_ARG_NONNULL ((4)));
871 _GL_CXXALIAS_RPL (fread
, size_t, (void *ptr
, size_t s
, size_t n
, FILE *stream
));
873 _GL_CXXALIAS_SYS (fread
, size_t, (void *ptr
, size_t s
, size_t n
, FILE *stream
));
875 _GL_CXXALIASWARN (fread
);
880 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
882 # define freopen rpl_freopen
884 _GL_FUNCDECL_RPL (freopen
, FILE *,
885 (const char *filename
, const char *mode
, FILE *stream
)
886 _GL_ARG_NONNULL ((2, 3)));
887 _GL_CXXALIAS_RPL (freopen
, FILE *,
888 (const char *filename
, const char *mode
, FILE *stream
));
890 _GL_CXXALIAS_SYS (freopen
, FILE *,
891 (const char *filename
, const char *mode
, FILE *stream
));
893 _GL_CXXALIASWARN (freopen
);
894 #elif defined GNULIB_POSIXCHECK
896 /* Assume freopen is always declared. */
897 _GL_WARN_ON_USE (freopen
,
898 "freopen on native Windows platforms is not POSIX compliant - "
899 "use gnulib module freopen for portability");
904 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
906 # define fscanf rpl_fscanf
908 _GL_FUNCDECL_RPL (fscanf
, int, (FILE *stream
, const char *format
, ...)
909 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
910 _GL_ARG_NONNULL ((1, 2)));
911 _GL_CXXALIAS_RPL (fscanf
, int, (FILE *stream
, const char *format
, ...));
913 _GL_CXXALIAS_SYS (fscanf
, int, (FILE *stream
, const char *format
, ...));
915 _GL_CXXALIASWARN (fscanf
);
919 /* Set up the following warnings, based on which modules are in use.
920 GNU Coding Standards discourage the use of fseek, since it imposes
921 an arbitrary limitation on some 32-bit hosts. Remember that the
922 fseek module depends on the fseeko module, so we only have three
925 1. The developer is not using either module. Issue a warning under
926 GNULIB_POSIXCHECK for both functions, to remind them that both
927 functions have bugs on some systems. _GL_NO_LARGE_FILES has no
928 impact on this warning.
930 2. The developer is using both modules. They may be unaware of the
931 arbitrary limitations of fseek, so issue a warning under
932 GNULIB_POSIXCHECK. On the other hand, they may be using both
933 modules intentionally, so the developer can define
934 _GL_NO_LARGE_FILES in the compilation units where the use of fseek
935 is safe, to silence the warning.
937 3. The developer is using the fseeko module, but not fseek. Gnulib
938 guarantees that fseek will still work around platform bugs in that
939 case, but we presume that the developer is aware of the pitfalls of
940 fseek and was trying to avoid it, so issue a warning even when
941 GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
942 defined to silence the warning in particular compilation units.
943 In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
944 fseek gets defined as a macro, it is recommended that the developer
945 uses the fseek module, even if he is not calling the fseek function.
947 Most gnulib clients that perform stream operations should fall into
951 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
952 # define _GL_FSEEK_WARN /* Category 2, above. */
956 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
958 # define fseek rpl_fseek
960 _GL_FUNCDECL_RPL (fseek
, int, (FILE *fp
, long offset
, int whence
)
961 _GL_ARG_NONNULL ((1)));
962 _GL_CXXALIAS_RPL (fseek
, int, (FILE *fp
, long offset
, int whence
));
964 _GL_CXXALIAS_SYS (fseek
, int, (FILE *fp
, long offset
, int whence
));
966 _GL_CXXALIASWARN (fseek
);
970 # if !1 && !defined _GL_NO_LARGE_FILES
971 # define _GL_FSEEK_WARN /* Category 3, above. */
975 /* Provide an fseeko function that is aware of a preceding fflush(), and which
977 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
979 # define fseeko rpl_fseeko
981 _GL_FUNCDECL_RPL (fseeko
, int, (FILE *fp
, off_t offset
, int whence
)
982 _GL_ARG_NONNULL ((1)));
983 _GL_CXXALIAS_RPL (fseeko
, int, (FILE *fp
, off_t offset
, int whence
));
986 _GL_FUNCDECL_SYS (fseeko
, int, (FILE *fp
, off_t offset
, int whence
)
987 _GL_ARG_NONNULL ((1)));
989 _GL_CXXALIAS_SYS (fseeko
, int, (FILE *fp
, off_t offset
, int whence
));
991 _GL_CXXALIASWARN (fseeko
);
992 #elif defined GNULIB_POSIXCHECK
993 # define _GL_FSEEK_WARN /* Category 1, above. */
996 # if HAVE_RAW_DECL_FSEEKO
997 _GL_WARN_ON_USE (fseeko
, "fseeko is unportable - "
998 "use gnulib module fseeko for portability");
1002 #ifdef _GL_FSEEK_WARN
1003 # undef _GL_FSEEK_WARN
1004 /* Here, either fseek is undefined (but C89 guarantees that it is
1005 declared), or it is defined as rpl_fseek (declared above). */
1006 _GL_WARN_ON_USE (fseek
, "fseek cannot handle files larger than 4 GB "
1007 "on 32-bit platforms - "
1008 "use fseeko function for handling of large files");
1012 /* ftell, ftello. See the comments on fseek/fseeko. */
1015 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
1016 # define _GL_FTELL_WARN /* Category 2, above. */
1020 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1022 # define ftell rpl_ftell
1024 _GL_FUNCDECL_RPL (ftell
, long, (FILE *fp
) _GL_ARG_NONNULL ((1)));
1025 _GL_CXXALIAS_RPL (ftell
, long, (FILE *fp
));
1027 _GL_CXXALIAS_SYS (ftell
, long, (FILE *fp
));
1029 _GL_CXXALIASWARN (ftell
);
1033 # if !1 && !defined _GL_NO_LARGE_FILES
1034 # define _GL_FTELL_WARN /* Category 3, above. */
1038 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1040 # define ftello rpl_ftello
1042 _GL_FUNCDECL_RPL (ftello
, off_t
, (FILE *fp
) _GL_ARG_NONNULL ((1)));
1043 _GL_CXXALIAS_RPL (ftello
, off_t
, (FILE *fp
));
1046 _GL_FUNCDECL_SYS (ftello
, off_t
, (FILE *fp
) _GL_ARG_NONNULL ((1)));
1048 _GL_CXXALIAS_SYS (ftello
, off_t
, (FILE *fp
));
1050 _GL_CXXALIASWARN (ftello
);
1051 #elif defined GNULIB_POSIXCHECK
1052 # define _GL_FTELL_WARN /* Category 1, above. */
1055 # if HAVE_RAW_DECL_FTELLO
1056 _GL_WARN_ON_USE (ftello
, "ftello is unportable - "
1057 "use gnulib module ftello for portability");
1061 #ifdef _GL_FTELL_WARN
1062 # undef _GL_FTELL_WARN
1063 /* Here, either ftell is undefined (but C89 guarantees that it is
1064 declared), or it is defined as rpl_ftell (declared above). */
1065 _GL_WARN_ON_USE (ftell
, "ftell cannot handle files larger than 4 GB "
1066 "on 32-bit platforms - "
1067 "use ftello function for handling of large files");
1073 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1075 # define fwrite rpl_fwrite
1077 _GL_FUNCDECL_RPL (fwrite
, size_t,
1078 (const void *ptr
, size_t s
, size_t n
, FILE *stream
)
1079 _GL_ARG_NONNULL ((1, 4)));
1080 _GL_CXXALIAS_RPL (fwrite
, size_t,
1081 (const void *ptr
, size_t s
, size_t n
, FILE *stream
));
1083 _GL_CXXALIAS_SYS (fwrite
, size_t,
1084 (const void *ptr
, size_t s
, size_t n
, FILE *stream
));
1086 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
1087 <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
1088 which sometimes causes an unwanted diagnostic for fwrite calls.
1089 This affects only function declaration attributes under certain
1090 versions of gcc and clang, and is not needed for C++. */
1091 # if (0 < __USE_FORTIFY_LEVEL \
1092 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
1093 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
1094 && !defined __cplusplus)
1096 # undef fwrite_unlocked
1097 extern size_t __REDIRECT (rpl_fwrite
,
1098 (const void *__restrict
, size_t, size_t,
1101 extern size_t __REDIRECT (rpl_fwrite_unlocked
,
1102 (const void *__restrict
, size_t, size_t,
1105 # define fwrite rpl_fwrite
1106 # define fwrite_unlocked rpl_fwrite_unlocked
1109 _GL_CXXALIASWARN (fwrite
);
1114 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1116 # define getc rpl_fgetc
1118 _GL_FUNCDECL_RPL (fgetc
, int, (FILE *stream
) _GL_ARG_NONNULL ((1)));
1119 _GL_CXXALIAS_RPL_1 (getc
, rpl_fgetc
, int, (FILE *stream
));
1121 _GL_CXXALIAS_SYS (getc
, int, (FILE *stream
));
1123 _GL_CXXALIASWARN (getc
);
1128 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1130 # define getchar rpl_getchar
1132 _GL_FUNCDECL_RPL (getchar
, int, (void));
1133 _GL_CXXALIAS_RPL (getchar
, int, (void));
1135 _GL_CXXALIAS_SYS (getchar
, int, (void));
1137 _GL_CXXALIASWARN (getchar
);
1141 /* Read input, up to (and including) the next occurrence of DELIMITER, from
1142 STREAM, store it in *LINEPTR (and NUL-terminate it).
1143 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
1144 bytes of space. It is realloc'd as necessary.
1145 Return the number of bytes read and stored at *LINEPTR (not including the
1146 NUL terminator), or -1 on error or EOF. */
1148 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1150 # define getdelim rpl_getdelim
1152 _GL_FUNCDECL_RPL (getdelim
, ssize_t
,
1153 (char **lineptr
, size_t *linesize
, int delimiter
,
1155 _GL_ARG_NONNULL ((1, 2, 4)));
1156 _GL_CXXALIAS_RPL (getdelim
, ssize_t
,
1157 (char **lineptr
, size_t *linesize
, int delimiter
,
1161 _GL_FUNCDECL_SYS (getdelim
, ssize_t
,
1162 (char **lineptr
, size_t *linesize
, int delimiter
,
1164 _GL_ARG_NONNULL ((1, 2, 4)));
1166 _GL_CXXALIAS_SYS (getdelim
, ssize_t
,
1167 (char **lineptr
, size_t *linesize
, int delimiter
,
1170 _GL_CXXALIASWARN (getdelim
);
1171 #elif defined GNULIB_POSIXCHECK
1173 # if HAVE_RAW_DECL_GETDELIM
1174 _GL_WARN_ON_USE (getdelim
, "getdelim is unportable - "
1175 "use gnulib module getdelim for portability");
1180 /* Read a line, up to (and including) the next newline, from STREAM, store it
1181 in *LINEPTR (and NUL-terminate it).
1182 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
1183 bytes of space. It is realloc'd as necessary.
1184 Return the number of bytes read and stored at *LINEPTR (not including the
1185 NUL terminator), or -1 on error or EOF. */
1187 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1189 # define getline rpl_getline
1191 _GL_FUNCDECL_RPL (getline
, ssize_t
,
1192 (char **lineptr
, size_t *linesize
, FILE *stream
)
1193 _GL_ARG_NONNULL ((1, 2, 3)));
1194 _GL_CXXALIAS_RPL (getline
, ssize_t
,
1195 (char **lineptr
, size_t *linesize
, FILE *stream
));
1198 _GL_FUNCDECL_SYS (getline
, ssize_t
,
1199 (char **lineptr
, size_t *linesize
, FILE *stream
)
1200 _GL_ARG_NONNULL ((1, 2, 3)));
1202 _GL_CXXALIAS_SYS (getline
, ssize_t
,
1203 (char **lineptr
, size_t *linesize
, FILE *stream
));
1206 _GL_CXXALIASWARN (getline
);
1208 #elif defined GNULIB_POSIXCHECK
1210 # if HAVE_RAW_DECL_GETLINE
1211 _GL_WARN_ON_USE (getline
, "getline is unportable - "
1212 "use gnulib module getline for portability");
1216 /* It is very rare that the developer ever has full control of stdin,
1217 so any use of gets warrants an unconditional warning; besides, C11
1220 #if HAVE_RAW_DECL_GETS && !defined __cplusplus
1221 _GL_WARN_ON_USE (gets
, "gets is a security hole - use fgets instead");
1226 /* Grow an obstack with formatted output. Return the number of
1227 bytes added to OBS. No trailing nul byte is added, and the
1228 object should be closed with obstack_finish before use. Upon
1229 memory allocation error, call obstack_alloc_failed_handler. Upon
1230 other error, return -1. */
1232 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1233 # define obstack_printf rpl_obstack_printf
1235 _GL_FUNCDECL_RPL (obstack_printf
, int,
1236 (struct obstack
*obs
, const char *format
, ...)
1237 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1238 _GL_ARG_NONNULL ((1, 2)));
1239 _GL_CXXALIAS_RPL (obstack_printf
, int,
1240 (struct obstack
*obs
, const char *format
, ...));
1243 _GL_FUNCDECL_SYS (obstack_printf
, int,
1244 (struct obstack
*obs
, const char *format
, ...)
1245 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1246 _GL_ARG_NONNULL ((1, 2)));
1248 _GL_CXXALIAS_SYS (obstack_printf
, int,
1249 (struct obstack
*obs
, const char *format
, ...));
1251 _GL_CXXALIASWARN (obstack_printf
);
1253 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1254 # define obstack_vprintf rpl_obstack_vprintf
1256 _GL_FUNCDECL_RPL (obstack_vprintf
, int,
1257 (struct obstack
*obs
, const char *format
, va_list args
)
1258 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1259 _GL_ARG_NONNULL ((1, 2)));
1260 _GL_CXXALIAS_RPL (obstack_vprintf
, int,
1261 (struct obstack
*obs
, const char *format
, va_list args
));
1264 _GL_FUNCDECL_SYS (obstack_vprintf
, int,
1265 (struct obstack
*obs
, const char *format
, va_list args
)
1266 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1267 _GL_ARG_NONNULL ((1, 2)));
1269 _GL_CXXALIAS_SYS (obstack_vprintf
, int,
1270 (struct obstack
*obs
, const char *format
, va_list args
));
1272 _GL_CXXALIASWARN (obstack_vprintf
);
1277 _GL_FUNCDECL_SYS (pclose
, int, (FILE *stream
) _GL_ARG_NONNULL ((1)));
1279 _GL_CXXALIAS_SYS (pclose
, int, (FILE *stream
));
1280 _GL_CXXALIASWARN (pclose
);
1281 #elif defined GNULIB_POSIXCHECK
1283 # if HAVE_RAW_DECL_PCLOSE
1284 _GL_WARN_ON_USE (pclose
, "pclose is unportable - "
1285 "use gnulib module pclose for more portability");
1290 /* Print a message to standard error, describing the value of ERRNO,
1291 (if STRING is not NULL and not empty) prefixed with STRING and ": ",
1292 and terminated with a newline. */
1294 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1295 # define perror rpl_perror
1297 _GL_FUNCDECL_RPL (perror
, void, (const char *string
));
1298 _GL_CXXALIAS_RPL (perror
, void, (const char *string
));
1300 _GL_CXXALIAS_SYS (perror
, void, (const char *string
));
1302 _GL_CXXALIASWARN (perror
);
1303 #elif defined GNULIB_POSIXCHECK
1305 /* Assume perror is always declared. */
1306 _GL_WARN_ON_USE (perror
, "perror is not always POSIX compliant - "
1307 "use gnulib module perror for portability");
1312 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1314 # define popen rpl_popen
1316 _GL_FUNCDECL_RPL (popen
, FILE *, (const char *cmd
, const char *mode
)
1317 _GL_ARG_NONNULL ((1, 2)));
1318 _GL_CXXALIAS_RPL (popen
, FILE *, (const char *cmd
, const char *mode
));
1321 _GL_FUNCDECL_SYS (popen
, FILE *, (const char *cmd
, const char *mode
)
1322 _GL_ARG_NONNULL ((1, 2)));
1324 _GL_CXXALIAS_SYS (popen
, FILE *, (const char *cmd
, const char *mode
));
1326 _GL_CXXALIASWARN (popen
);
1327 #elif defined GNULIB_POSIXCHECK
1329 # if HAVE_RAW_DECL_POPEN
1330 _GL_WARN_ON_USE (popen
, "popen is buggy on some platforms - "
1331 "use gnulib module popen or pipe for more portability");
1337 || (1 && 0 && (0 || 0))
1338 # if defined __GNUC__
1339 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1340 /* Don't break __attribute__((format(printf,M,N))). */
1341 # define printf __printf__
1344 _GL_FUNCDECL_RPL_1 (__printf__
, int,
1345 (const char *format
, ...)
1347 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf
))
1348 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
1349 _GL_ARG_NONNULL ((1)));
1351 _GL_FUNCDECL_RPL_1 (__printf__
, int,
1352 (const char *format
, ...)
1354 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf
))
1355 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
1356 _GL_ARG_NONNULL ((1)));
1358 _GL_CXXALIAS_RPL_1 (printf
, __printf__
, int, (const char *format
, ...));
1360 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1361 # define printf rpl_printf
1363 _GL_FUNCDECL_RPL (printf
, int,
1364 (const char *format
, ...)
1365 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
1366 _GL_ARG_NONNULL ((1)));
1367 _GL_CXXALIAS_RPL (printf
, int, (const char *format
, ...));
1369 # define GNULIB_overrides_printf 1
1371 _GL_CXXALIAS_SYS (printf
, int, (const char *format
, ...));
1373 _GL_CXXALIASWARN (printf
);
1375 #if !1 && defined GNULIB_POSIXCHECK
1376 # if !GNULIB_overrides_printf
1379 /* Assume printf is always declared. */
1380 _GL_WARN_ON_USE (printf
, "printf is not always POSIX compliant - "
1381 "use gnulib module printf-posix for portable "
1382 "POSIX compliance");
1387 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1389 # define putc rpl_fputc
1391 _GL_FUNCDECL_RPL (fputc
, int, (int c
, FILE *stream
) _GL_ARG_NONNULL ((2)));
1392 _GL_CXXALIAS_RPL_1 (putc
, rpl_fputc
, int, (int c
, FILE *stream
));
1394 _GL_CXXALIAS_SYS (putc
, int, (int c
, FILE *stream
));
1396 _GL_CXXALIASWARN (putc
);
1401 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1403 # define putchar rpl_putchar
1405 _GL_FUNCDECL_RPL (putchar
, int, (int c
));
1406 _GL_CXXALIAS_RPL (putchar
, int, (int c
));
1408 _GL_CXXALIAS_SYS (putchar
, int, (int c
));
1410 _GL_CXXALIASWARN (putchar
);
1415 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1417 # define puts rpl_puts
1419 _GL_FUNCDECL_RPL (puts
, int, (const char *string
) _GL_ARG_NONNULL ((1)));
1420 _GL_CXXALIAS_RPL (puts
, int, (const char *string
));
1422 _GL_CXXALIAS_SYS (puts
, int, (const char *string
));
1424 _GL_CXXALIASWARN (puts
);
1429 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1431 # define remove rpl_remove
1433 _GL_FUNCDECL_RPL (remove
, int, (const char *name
) _GL_ARG_NONNULL ((1)));
1434 _GL_CXXALIAS_RPL (remove
, int, (const char *name
));
1436 _GL_CXXALIAS_SYS (remove
, int, (const char *name
));
1438 _GL_CXXALIASWARN (remove
);
1439 #elif defined GNULIB_POSIXCHECK
1441 /* Assume remove is always declared. */
1442 _GL_WARN_ON_USE (remove
, "remove cannot handle directories on some platforms - "
1443 "use gnulib module remove for more portability");
1448 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1450 # define rename rpl_rename
1452 _GL_FUNCDECL_RPL (rename
, int,
1453 (const char *old_filename
, const char *new_filename
)
1454 _GL_ARG_NONNULL ((1, 2)));
1455 _GL_CXXALIAS_RPL (rename
, int,
1456 (const char *old_filename
, const char *new_filename
));
1458 _GL_CXXALIAS_SYS (rename
, int,
1459 (const char *old_filename
, const char *new_filename
));
1461 _GL_CXXALIASWARN (rename
);
1462 #elif defined GNULIB_POSIXCHECK
1464 /* Assume rename is always declared. */
1465 _GL_WARN_ON_USE (rename
, "rename is buggy on some platforms - "
1466 "use gnulib module rename for more portability");
1471 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1473 # define renameat rpl_renameat
1475 _GL_FUNCDECL_RPL (renameat
, int,
1476 (int fd1
, char const *file1
, int fd2
, char const *file2
)
1477 _GL_ARG_NONNULL ((2, 4)));
1478 _GL_CXXALIAS_RPL (renameat
, int,
1479 (int fd1
, char const *file1
, int fd2
, char const *file2
));
1482 _GL_FUNCDECL_SYS (renameat
, int,
1483 (int fd1
, char const *file1
, int fd2
, char const *file2
)
1484 _GL_ARG_NONNULL ((2, 4)));
1486 _GL_CXXALIAS_SYS (renameat
, int,
1487 (int fd1
, char const *file1
, int fd2
, char const *file2
));
1489 _GL_CXXALIASWARN (renameat
);
1490 #elif defined GNULIB_POSIXCHECK
1492 # if HAVE_RAW_DECL_RENAMEAT
1493 _GL_WARN_ON_USE (renameat
, "renameat is not portable - "
1494 "use gnulib module renameat for portability");
1500 # if defined __GNUC__
1501 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1503 /* Don't break __attribute__((format(scanf,M,N))). */
1504 # define scanf __scanf__
1506 _GL_FUNCDECL_RPL_1 (__scanf__
, int,
1507 (const char *format
, ...)
1509 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf
))
1510 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1511 _GL_ARG_NONNULL ((1)));
1512 _GL_CXXALIAS_RPL_1 (scanf
, __scanf__
, int, (const char *format
, ...));
1514 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1516 # define scanf rpl_scanf
1518 _GL_FUNCDECL_RPL (scanf
, int, (const char *format
, ...)
1519 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1520 _GL_ARG_NONNULL ((1)));
1521 _GL_CXXALIAS_RPL (scanf
, int, (const char *format
, ...));
1524 _GL_CXXALIAS_SYS (scanf
, int, (const char *format
, ...));
1526 _GL_CXXALIASWARN (scanf
);
1531 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1532 # define snprintf rpl_snprintf
1534 _GL_FUNCDECL_RPL (snprintf
, int,
1535 (char *str
, size_t size
, const char *format
, ...)
1536 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1537 _GL_ARG_NONNULL ((3)));
1538 _GL_CXXALIAS_RPL (snprintf
, int,
1539 (char *str
, size_t size
, const char *format
, ...));
1542 _GL_FUNCDECL_SYS (snprintf
, int,
1543 (char *str
, size_t size
, const char *format
, ...)
1544 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1545 _GL_ARG_NONNULL ((3)));
1547 _GL_CXXALIAS_SYS (snprintf
, int,
1548 (char *str
, size_t size
, const char *format
, ...));
1550 _GL_CXXALIASWARN (snprintf
);
1551 #elif defined GNULIB_POSIXCHECK
1553 # if HAVE_RAW_DECL_SNPRINTF
1554 _GL_WARN_ON_USE (snprintf
, "snprintf is unportable - "
1555 "use gnulib module snprintf for portability");
1559 /* Some people would argue that all sprintf uses should be warned about
1560 (for example, OpenBSD issues a link warning for it),
1561 since it can cause security holes due to buffer overruns.
1562 However, we believe that sprintf can be used safely, and is more
1563 efficient than snprintf in those safe cases; and as proof of our
1564 belief, we use sprintf in several gnulib modules. So this header
1565 intentionally avoids adding a warning to sprintf except when
1566 GNULIB_POSIXCHECK is defined. */
1570 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1571 # define sprintf rpl_sprintf
1573 _GL_FUNCDECL_RPL (sprintf
, int, (char *str
, const char *format
, ...)
1574 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1575 _GL_ARG_NONNULL ((1, 2)));
1576 _GL_CXXALIAS_RPL (sprintf
, int, (char *str
, const char *format
, ...));
1578 _GL_CXXALIAS_SYS (sprintf
, int, (char *str
, const char *format
, ...));
1580 _GL_CXXALIASWARN (sprintf
);
1581 #elif defined GNULIB_POSIXCHECK
1583 /* Assume sprintf is always declared. */
1584 _GL_WARN_ON_USE (sprintf
, "sprintf is not always POSIX compliant - "
1585 "use gnulib module sprintf-posix for portable "
1586 "POSIX compliance");
1591 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1592 # define tmpfile rpl_tmpfile
1594 _GL_FUNCDECL_RPL (tmpfile
, FILE *, (void));
1595 _GL_CXXALIAS_RPL (tmpfile
, FILE *, (void));
1597 _GL_CXXALIAS_SYS (tmpfile
, FILE *, (void));
1599 _GL_CXXALIASWARN (tmpfile
);
1600 #elif defined GNULIB_POSIXCHECK
1602 # if HAVE_RAW_DECL_TMPFILE
1603 _GL_WARN_ON_USE (tmpfile
, "tmpfile is not usable on mingw - "
1604 "use gnulib module tmpfile for portability");
1609 /* Write formatted output to a string dynamically allocated with malloc().
1610 If the memory allocation succeeds, store the address of the string in
1611 *RESULT and return the number of resulting bytes, excluding the trailing
1612 NUL. Upon memory allocation error, or some other error, return -1. */
1614 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1615 # define asprintf rpl_asprintf
1617 _GL_FUNCDECL_RPL (asprintf
, int,
1618 (char **result
, const char *format
, ...)
1619 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1620 _GL_ARG_NONNULL ((1, 2)));
1621 _GL_CXXALIAS_RPL (asprintf
, int,
1622 (char **result
, const char *format
, ...));
1625 _GL_FUNCDECL_SYS (asprintf
, int,
1626 (char **result
, const char *format
, ...)
1627 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1628 _GL_ARG_NONNULL ((1, 2)));
1630 _GL_CXXALIAS_SYS (asprintf
, int,
1631 (char **result
, const char *format
, ...));
1633 _GL_CXXALIASWARN (asprintf
);
1635 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1636 # define vasprintf rpl_vasprintf
1638 _GL_FUNCDECL_RPL (vasprintf
, int,
1639 (char **result
, const char *format
, va_list args
)
1640 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1641 _GL_ARG_NONNULL ((1, 2)));
1642 _GL_CXXALIAS_RPL (vasprintf
, int,
1643 (char **result
, const char *format
, va_list args
));
1646 _GL_FUNCDECL_SYS (vasprintf
, int,
1647 (char **result
, const char *format
, va_list args
)
1648 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1649 _GL_ARG_NONNULL ((1, 2)));
1651 _GL_CXXALIAS_SYS (vasprintf
, int,
1652 (char **result
, const char *format
, va_list args
));
1654 _GL_CXXALIASWARN (vasprintf
);
1659 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1660 # define vdprintf rpl_vdprintf
1662 _GL_FUNCDECL_RPL (vdprintf
, int, (int fd
, const char *format
, va_list args
)
1663 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1664 _GL_ARG_NONNULL ((2)));
1665 _GL_CXXALIAS_RPL (vdprintf
, int, (int fd
, const char *format
, va_list args
));
1668 _GL_FUNCDECL_SYS (vdprintf
, int, (int fd
, const char *format
, va_list args
)
1669 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1670 _GL_ARG_NONNULL ((2)));
1672 /* Need to cast, because on Solaris, the third parameter will likely be
1674 _GL_CXXALIAS_SYS_CAST (vdprintf
, int,
1675 (int fd
, const char *format
, va_list args
));
1677 _GL_CXXALIASWARN (vdprintf
);
1678 #elif defined GNULIB_POSIXCHECK
1680 # if HAVE_RAW_DECL_VDPRINTF
1681 _GL_WARN_ON_USE (vdprintf
, "vdprintf is unportable - "
1682 "use gnulib module vdprintf for portability");
1688 || (1 && 0 && (0 || 0))
1689 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1690 # define vfprintf rpl_vfprintf
1692 # define GNULIB_overrides_vfprintf 1
1694 _GL_FUNCDECL_RPL (vfprintf
, int, (FILE *fp
, const char *format
, va_list args
)
1695 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1696 _GL_ARG_NONNULL ((1, 2)));
1698 _GL_FUNCDECL_RPL (vfprintf
, int, (FILE *fp
, const char *format
, va_list args
)
1699 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
1700 _GL_ARG_NONNULL ((1, 2)));
1702 _GL_CXXALIAS_RPL (vfprintf
, int, (FILE *fp
, const char *format
, va_list args
));
1704 /* Need to cast, because on Solaris, the third parameter is
1706 and GCC's fixincludes did not change this to __gnuc_va_list. */
1707 _GL_CXXALIAS_SYS_CAST (vfprintf
, int,
1708 (FILE *fp
, const char *format
, va_list args
));
1710 _GL_CXXALIASWARN (vfprintf
);
1712 #if !1 && defined GNULIB_POSIXCHECK
1713 # if !GNULIB_overrides_vfprintf
1716 /* Assume vfprintf is always declared. */
1717 _GL_WARN_ON_USE (vfprintf
, "vfprintf is not always POSIX compliant - "
1718 "use gnulib module vfprintf-posix for portable "
1719 "POSIX compliance");
1724 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1726 # define vfscanf rpl_vfscanf
1728 _GL_FUNCDECL_RPL (vfscanf
, int,
1729 (FILE *stream
, const char *format
, va_list args
)
1730 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
1731 _GL_ARG_NONNULL ((1, 2)));
1732 _GL_CXXALIAS_RPL (vfscanf
, int,
1733 (FILE *stream
, const char *format
, va_list args
));
1735 _GL_CXXALIAS_SYS (vfscanf
, int,
1736 (FILE *stream
, const char *format
, va_list args
));
1738 _GL_CXXALIASWARN (vfscanf
);
1743 || (1 && 0 && (0 || 0))
1744 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1745 # define vprintf rpl_vprintf
1747 # define GNULIB_overrides_vprintf 1
1749 _GL_FUNCDECL_RPL (vprintf
, int, (const char *format
, va_list args
)
1750 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
1751 _GL_ARG_NONNULL ((1)));
1753 _GL_FUNCDECL_RPL (vprintf
, int, (const char *format
, va_list args
)
1754 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
1755 _GL_ARG_NONNULL ((1)));
1757 _GL_CXXALIAS_RPL (vprintf
, int, (const char *format
, va_list args
));
1759 /* Need to cast, because on Solaris, the second parameter is
1761 and GCC's fixincludes did not change this to __gnuc_va_list. */
1762 _GL_CXXALIAS_SYS_CAST (vprintf
, int, (const char *format
, va_list args
));
1764 _GL_CXXALIASWARN (vprintf
);
1766 #if !0 && defined GNULIB_POSIXCHECK
1767 # if !GNULIB_overrides_vprintf
1770 /* Assume vprintf is always declared. */
1771 _GL_WARN_ON_USE (vprintf
, "vprintf is not always POSIX compliant - "
1772 "use gnulib module vprintf-posix for portable "
1773 "POSIX compliance");
1778 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1780 # define vscanf rpl_vscanf
1782 _GL_FUNCDECL_RPL (vscanf
, int, (const char *format
, va_list args
)
1783 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
1784 _GL_ARG_NONNULL ((1)));
1785 _GL_CXXALIAS_RPL (vscanf
, int, (const char *format
, va_list args
));
1787 _GL_CXXALIAS_SYS (vscanf
, int, (const char *format
, va_list args
));
1789 _GL_CXXALIASWARN (vscanf
);
1794 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1795 # define vsnprintf rpl_vsnprintf
1797 _GL_FUNCDECL_RPL (vsnprintf
, int,
1798 (char *str
, size_t size
, const char *format
, va_list args
)
1799 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1800 _GL_ARG_NONNULL ((3)));
1801 _GL_CXXALIAS_RPL (vsnprintf
, int,
1802 (char *str
, size_t size
, const char *format
, va_list args
));
1805 _GL_FUNCDECL_SYS (vsnprintf
, int,
1806 (char *str
, size_t size
, const char *format
, va_list args
)
1807 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1808 _GL_ARG_NONNULL ((3)));
1810 _GL_CXXALIAS_SYS (vsnprintf
, int,
1811 (char *str
, size_t size
, const char *format
, va_list args
));
1813 _GL_CXXALIASWARN (vsnprintf
);
1814 #elif defined GNULIB_POSIXCHECK
1816 # if HAVE_RAW_DECL_VSNPRINTF
1817 _GL_WARN_ON_USE (vsnprintf
, "vsnprintf is unportable - "
1818 "use gnulib module vsnprintf for portability");
1824 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1825 # define vsprintf rpl_vsprintf
1827 _GL_FUNCDECL_RPL (vsprintf
, int,
1828 (char *str
, const char *format
, va_list args
)
1829 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1830 _GL_ARG_NONNULL ((1, 2)));
1831 _GL_CXXALIAS_RPL (vsprintf
, int,
1832 (char *str
, const char *format
, va_list args
));
1834 /* Need to cast, because on Solaris, the third parameter is
1836 and GCC's fixincludes did not change this to __gnuc_va_list. */
1837 _GL_CXXALIAS_SYS_CAST (vsprintf
, int,
1838 (char *str
, const char *format
, va_list args
));
1840 _GL_CXXALIASWARN (vsprintf
);
1841 #elif defined GNULIB_POSIXCHECK
1843 /* Assume vsprintf is always declared. */
1844 _GL_WARN_ON_USE (vsprintf
, "vsprintf is not always POSIX compliant - "
1845 "use gnulib module vsprintf-posix for portable "
1846 "POSIX compliance");
1849 #endif /* _GL_STDIO_H */
1850 #endif /* _GL_STDIO_H */