GDBserver

stdio.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <stdio.h>.
3
4 Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
5
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)
9 any later version.
10
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.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>. */
18
19 #if __GNUC__ >= 3
20 #pragma GCC system_header
21 #endif
22
23
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. */
32
33 #include_next <stdio.h>
34
35 #else
36 /* Normal invocation convention. */
37
38 #ifndef _GL_STDIO_H
39
40 #define _GL_ALREADY_INCLUDING_STDIO_H
41
42 /* The include_next requires a split double-inclusion guard. */
43 #include_next <stdio.h>
44
45 #undef _GL_ALREADY_INCLUDING_STDIO_H
46
47 #ifndef _GL_STDIO_H
48 #define _GL_STDIO_H
49
50 /* Get va_list. Needed on many systems, including glibc 2.8. */
51 #include <stdarg.h>
52
53 #include <stddef.h>
54
55 /* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
56 and eglibc 2.11.2.
57 May also define off_t to a 64-bit type on native Windows. */
58 #include <sys/types.h>
59
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))
68 #else
69 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
70 #endif
71
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
75 and POSIX. */
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))
79 #else
80 # define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
81 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
82 #endif
83
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
87 ISO C99 and POSIX. */
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)
91 #else
92 # define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
93 _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
94 #endif
95
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
99 and POSIX. */
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))
103 #else
104 # define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
105 _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
106 #endif
107
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))
114
115 /* Solaris 10 declares 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 \
118 && ! defined __GLIBC__
119 # include <unistd.h>
120 #endif
121
122
123 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
124 #ifndef _GL_CXXDEFS_H
125 #define _GL_CXXDEFS_H
126
127 /* Begin/end the GNULIB_NAMESPACE namespace. */
128 #if defined __cplusplus && defined GNULIB_NAMESPACE
129 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
130 # define _GL_END_NAMESPACE }
131 #else
132 # define _GL_BEGIN_NAMESPACE
133 # define _GL_END_NAMESPACE
134 #endif
135
136 /* The three most frequent use cases of these macros are:
137
138 * For providing a substitute for a function that is missing on some
139 platforms, but is declared and works fine on the platforms on which
140 it exists:
141
142 #if @GNULIB_FOO@
143 # if !@HAVE_FOO@
144 _GL_FUNCDECL_SYS (foo, ...);
145 # endif
146 _GL_CXXALIAS_SYS (foo, ...);
147 _GL_CXXALIASWARN (foo);
148 #elif defined GNULIB_POSIXCHECK
149 ...
150 #endif
151
152 * For providing a replacement for a function that exists on all platforms,
153 but is broken/insufficient and needs to be replaced on some platforms:
154
155 #if @GNULIB_FOO@
156 # if @REPLACE_FOO@
157 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
158 # undef foo
159 # define foo rpl_foo
160 # endif
161 _GL_FUNCDECL_RPL (foo, ...);
162 _GL_CXXALIAS_RPL (foo, ...);
163 # else
164 _GL_CXXALIAS_SYS (foo, ...);
165 # endif
166 _GL_CXXALIASWARN (foo);
167 #elif defined GNULIB_POSIXCHECK
168 ...
169 #endif
170
171 * For providing a replacement for a function that exists on some platforms
172 but is broken/insufficient and needs to be replaced on some of them and
173 is additionally either missing or undeclared on some other platforms:
174
175 #if @GNULIB_FOO@
176 # if @REPLACE_FOO@
177 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
178 # undef foo
179 # define foo rpl_foo
180 # endif
181 _GL_FUNCDECL_RPL (foo, ...);
182 _GL_CXXALIAS_RPL (foo, ...);
183 # else
184 # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
185 _GL_FUNCDECL_SYS (foo, ...);
186 # endif
187 _GL_CXXALIAS_SYS (foo, ...);
188 # endif
189 _GL_CXXALIASWARN (foo);
190 #elif defined GNULIB_POSIXCHECK
191 ...
192 #endif
193 */
194
195 /* _GL_EXTERN_C declaration;
196 performs the declaration with C linkage. */
197 #if defined __cplusplus
198 # define _GL_EXTERN_C extern "C"
199 #else
200 # define _GL_EXTERN_C extern
201 #endif
202
203 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
204 declares a replacement function, named rpl_func, with the given prototype,
205 consisting of return type, parameters, and attributes.
206 Example:
207 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
208 _GL_ARG_NONNULL ((1)));
209 */
210 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
211 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
212 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
213 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
214
215 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
216 declares the system function, named func, with the given prototype,
217 consisting of return type, parameters, and attributes.
218 Example:
219 _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
220 _GL_ARG_NONNULL ((1)));
221 */
222 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
223 _GL_EXTERN_C rettype func parameters_and_attributes
224
225 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
226 declares a C++ alias called GNULIB_NAMESPACE::func
227 that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
228 Example:
229 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
230
231 Wrapping rpl_func in an object with an inline conversion operator
232 avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
233 actually used in the program. */
234 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
235 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
236 #if defined __cplusplus && defined GNULIB_NAMESPACE
237 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
238 namespace GNULIB_NAMESPACE \
239 { \
240 static const struct _gl_ ## func ## _wrapper \
241 { \
242 typedef rettype (*type) parameters; \
243 inline type rpl () const { return ::rpl_func; } \
244 inline operator type () const { return rpl (); } \
245 } func = {}; \
246 } \
247 _GL_EXTERN_C int _gl_cxxalias_dummy
248 #else
249 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
250 _GL_EXTERN_C int _gl_cxxalias_dummy
251 #endif
252
253 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
254 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
255 except that the C function rpl_func may have a slightly different
256 declaration. A cast is used to silence the "invalid conversion" error
257 that would otherwise occur. */
258 #if defined __cplusplus && defined GNULIB_NAMESPACE
259 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
260 namespace GNULIB_NAMESPACE \
261 { \
262 static const struct _gl_ ## func ## _wrapper \
263 { \
264 typedef rettype (*type) parameters; \
265 inline type rpl () const \
266 { return reinterpret_cast<type>(::rpl_func); } \
267 inline operator type () const { return rpl (); } \
268 } func = {}; \
269 } \
270 _GL_EXTERN_C int _gl_cxxalias_dummy
271 #else
272 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
273 _GL_EXTERN_C int _gl_cxxalias_dummy
274 #endif
275
276 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
277 declares a C++ alias called GNULIB_NAMESPACE::func
278 that redirects to the system provided function func, if GNULIB_NAMESPACE
279 is defined.
280 Example:
281 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
282
283 Wrapping func in an object with an inline conversion operator
284 avoids a reference to func unless GNULIB_NAMESPACE::func is
285 actually used in the program. */
286 #if defined __cplusplus && defined GNULIB_NAMESPACE
287 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
288 namespace GNULIB_NAMESPACE \
289 { \
290 static const struct _gl_ ## func ## _wrapper \
291 { \
292 typedef rettype (*type) parameters; \
293 inline type rpl () const { return ::func; } \
294 inline operator type () const { return rpl (); } \
295 } func = {}; \
296 } \
297 _GL_EXTERN_C int _gl_cxxalias_dummy
298 #else
299 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
300 _GL_EXTERN_C int _gl_cxxalias_dummy
301 #endif
302
303 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
304 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
305 except that the C function func may have a slightly different declaration.
306 A cast is used to silence the "invalid conversion" error that would
307 otherwise occur. */
308 #if defined __cplusplus && defined GNULIB_NAMESPACE
309 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
310 namespace GNULIB_NAMESPACE \
311 { \
312 static const struct _gl_ ## func ## _wrapper \
313 { \
314 typedef rettype (*type) parameters; \
315 inline type rpl () const \
316 { return reinterpret_cast<type>(::func); } \
317 inline operator type () const { return rpl (); }\
318 } func = {}; \
319 } \
320 _GL_EXTERN_C int _gl_cxxalias_dummy
321 #else
322 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
323 _GL_EXTERN_C int _gl_cxxalias_dummy
324 #endif
325
326 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
327 is like _GL_CXXALIAS_SYS (func, rettype, parameters);
328 except that the C function is picked among a set of overloaded functions,
329 namely the one with rettype2 and parameters2. Two consecutive casts
330 are used to silence the "cannot find a match" and "invalid conversion"
331 errors that would otherwise occur. */
332 #if defined __cplusplus && defined GNULIB_NAMESPACE
333 /* The outer cast must be a reinterpret_cast.
334 The inner cast: When the function is defined as a set of overloaded
335 functions, it works as a static_cast<>, choosing the designated variant.
336 When the function is defined as a single variant, it works as a
337 reinterpret_cast<>. The parenthesized cast syntax works both ways. */
338 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
339 namespace GNULIB_NAMESPACE \
340 { \
341 static const struct _gl_ ## func ## _wrapper \
342 { \
343 typedef rettype (*type) parameters; \
344 \
345 inline type rpl () const \
346 { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
347 \
348 inline operator type () const { return rpl (); } \
349 } func = {}; \
350 } \
351 _GL_EXTERN_C int _gl_cxxalias_dummy
352 #else
353 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
354 _GL_EXTERN_C int _gl_cxxalias_dummy
355 #endif
356
357 /* _GL_CXXALIASWARN (func);
358 causes a warning to be emitted when ::func is used but not when
359 GNULIB_NAMESPACE::func is used. func must be defined without overloaded
360 variants. */
361 #if defined __cplusplus && defined GNULIB_NAMESPACE
362 # define _GL_CXXALIASWARN(func) \
363 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
364 # define _GL_CXXALIASWARN_1(func,namespace) \
365 _GL_CXXALIASWARN_2 (func, namespace)
366 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
367 we enable the warning only when not optimizing. */
368 # if !__OPTIMIZE__
369 # define _GL_CXXALIASWARN_2(func,namespace) \
370 _GL_WARN_ON_USE (func, \
371 "The symbol ::" #func " refers to the system function. " \
372 "Use " #namespace "::" #func " instead.")
373 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
374 # define _GL_CXXALIASWARN_2(func,namespace) \
375 extern __typeof__ (func) func
376 # else
377 # define _GL_CXXALIASWARN_2(func,namespace) \
378 _GL_EXTERN_C int _gl_cxxalias_dummy
379 # endif
380 #else
381 # define _GL_CXXALIASWARN(func) \
382 _GL_EXTERN_C int _gl_cxxalias_dummy
383 #endif
384
385 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
386 causes a warning to be emitted when the given overloaded variant of ::func
387 is used but not when GNULIB_NAMESPACE::func is used. */
388 #if defined __cplusplus && defined GNULIB_NAMESPACE
389 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
390 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
391 GNULIB_NAMESPACE)
392 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
393 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
394 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
395 we enable the warning only when not optimizing. */
396 # if !__OPTIMIZE__
397 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
398 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
399 "The symbol ::" #func " refers to the system function. " \
400 "Use " #namespace "::" #func " instead.")
401 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
402 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
403 extern __typeof__ (func) func
404 # else
405 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
406 _GL_EXTERN_C int _gl_cxxalias_dummy
407 # endif
408 #else
409 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
410 _GL_EXTERN_C int _gl_cxxalias_dummy
411 #endif
412
413 #endif /* _GL_CXXDEFS_H */
414
415 /* The definition of _GL_ARG_NONNULL is copied here. */
416 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
417 that the values passed as arguments n, ..., m must be non-NULL pointers.
418 n = 1 stands for the first argument, n = 2 for the second argument etc. */
419 #ifndef _GL_ARG_NONNULL
420 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
421 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
422 # else
423 # define _GL_ARG_NONNULL(params)
424 # endif
425 #endif
426
427 /* The definition of _GL_WARN_ON_USE is copied here. */
428 #ifndef _GL_WARN_ON_USE
429
430 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
431 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
432 # define _GL_WARN_ON_USE(function, message) \
433 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
434 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
435 /* Verify the existence of the function. */
436 # define _GL_WARN_ON_USE(function, message) \
437 extern __typeof__ (function) function
438 # else /* Unsupported. */
439 # define _GL_WARN_ON_USE(function, message) \
440 _GL_WARN_EXTERN_C int _gl_warn_on_use
441 # endif
442 #endif
443
444 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
445 is like _GL_WARN_ON_USE (function, "string"), except that the function is
446 declared with the given prototype, consisting of return type, parameters,
447 and attributes.
448 This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
449 not work in this case. */
450 #ifndef _GL_WARN_ON_USE_CXX
451 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
452 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
453 extern rettype function parameters_and_attributes \
454 __attribute__ ((__warning__ (msg)))
455 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
456 /* Verify the existence of the function. */
457 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
458 extern rettype function parameters_and_attributes
459 # else /* Unsupported. */
460 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
461 _GL_WARN_EXTERN_C int _gl_warn_on_use
462 # endif
463 #endif
464
465 /* _GL_WARN_EXTERN_C declaration;
466 performs the declaration with C linkage. */
467 #ifndef _GL_WARN_EXTERN_C
468 # if defined __cplusplus
469 # define _GL_WARN_EXTERN_C extern "C"
470 # else
471 # define _GL_WARN_EXTERN_C extern
472 # endif
473 #endif
474
475 /* Macros for stringification. */
476 #define _GL_STDIO_STRINGIZE(token) #token
477 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
478
479 /* When also using extern inline, suppress the use of static inline in
480 standard headers of problematic Apple configurations, as Libc at
481 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
482 <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
483 Perhaps Apple will fix this some day. */
484 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
485 && defined __GNUC__ && defined __STDC__)
486 # undef putc_unlocked
487 #endif
488
489 #if 0
490 # if 0
491 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
492 # define dprintf rpl_dprintf
493 # endif
494 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
495 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
496 _GL_ARG_NONNULL ((2)));
497 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
498 # else
499 # if !1
500 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
501 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
502 _GL_ARG_NONNULL ((2)));
503 # endif
504 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
505 # endif
506 _GL_CXXALIASWARN (dprintf);
507 #elif defined GNULIB_POSIXCHECK
508 # undef dprintf
509 # if HAVE_RAW_DECL_DPRINTF
510 _GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
511 "use gnulib module dprintf for portability");
512 # endif
513 #endif
514
515 #if 0
516 /* Close STREAM and its underlying file descriptor. */
517 # if 0
518 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
519 # define fclose rpl_fclose
520 # endif
521 _GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
522 _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
523 # else
524 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
525 # endif
526 _GL_CXXALIASWARN (fclose);
527 #elif defined GNULIB_POSIXCHECK
528 # undef fclose
529 /* Assume fclose is always declared. */
530 _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
531 "use gnulib module fclose for portable POSIX compliance");
532 #endif
533
534 #if 0
535 # if 0
536 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
537 # undef fdopen
538 # define fdopen rpl_fdopen
539 # endif
540 _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
541 _GL_ARG_NONNULL ((2)));
542 _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
543 # else
544 _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
545 # endif
546 _GL_CXXALIASWARN (fdopen);
547 #elif defined GNULIB_POSIXCHECK
548 # undef fdopen
549 /* Assume fdopen is always declared. */
550 _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
551 "use gnulib module fdopen for portability");
552 #endif
553
554 #if 0
555 /* Flush all pending data on STREAM according to POSIX rules. Both
556 output and seekable input streams are supported.
557 Note! LOSS OF DATA can occur if fflush is applied on an input stream
558 that is _not_seekable_ or on an update stream that is _not_seekable_
559 and in which the most recent operation was input. Seekability can
560 be tested with lseek(fileno(fp),0,SEEK_CUR). */
561 # if 0
562 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
563 # define fflush rpl_fflush
564 # endif
565 _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
566 _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
567 # else
568 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
569 # endif
570 _GL_CXXALIASWARN (fflush);
571 #elif defined GNULIB_POSIXCHECK
572 # undef fflush
573 /* Assume fflush is always declared. */
574 _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
575 "use gnulib module fflush for portable POSIX compliance");
576 #endif
577
578 #if 1
579 # if 0 && 0
580 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
581 # undef fgetc
582 # define fgetc rpl_fgetc
583 # endif
584 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
585 _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
586 # else
587 _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
588 # endif
589 _GL_CXXALIASWARN (fgetc);
590 #endif
591
592 #if 1
593 # if 0 && 0
594 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
595 # undef fgets
596 # define fgets rpl_fgets
597 # endif
598 _GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
599 _GL_ARG_NONNULL ((1, 3)));
600 _GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
601 # else
602 _GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
603 # endif
604 _GL_CXXALIASWARN (fgets);
605 #endif
606
607 #if 0
608 # if 0
609 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
610 # undef fopen
611 # define fopen rpl_fopen
612 # endif
613 _GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
614 _GL_ARG_NONNULL ((1, 2)));
615 _GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
616 # else
617 _GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
618 # endif
619 _GL_CXXALIASWARN (fopen);
620 #elif defined GNULIB_POSIXCHECK
621 # undef fopen
622 /* Assume fopen is always declared. */
623 _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
624 "use gnulib module fopen for portability");
625 #endif
626
627 #if 0 || 1
628 # if (0 && 0) \
629 || (1 && 0 && (0 || 0))
630 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
631 # define fprintf rpl_fprintf
632 # endif
633 # define GNULIB_overrides_fprintf 1
634 # if 0 || 0
635 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
636 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
637 _GL_ARG_NONNULL ((1, 2)));
638 # else
639 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
640 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
641 _GL_ARG_NONNULL ((1, 2)));
642 # endif
643 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
644 # else
645 _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
646 # endif
647 _GL_CXXALIASWARN (fprintf);
648 #endif
649 #if !0 && defined GNULIB_POSIXCHECK
650 # if !GNULIB_overrides_fprintf
651 # undef fprintf
652 # endif
653 /* Assume fprintf is always declared. */
654 _GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
655 "use gnulib module fprintf-posix for portable "
656 "POSIX compliance");
657 #endif
658
659 #if 0
660 /* Discard all pending buffered I/O data on STREAM.
661 STREAM must not be wide-character oriented.
662 When discarding pending output, the file position is set back to where it
663 was before the write calls. When discarding pending input, the file
664 position is advanced to match the end of the previously read input.
665 Return 0 if successful. Upon error, return -1 and set errno. */
666 # if 0
667 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
668 # define fpurge rpl_fpurge
669 # endif
670 _GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
671 _GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
672 # else
673 # if !1
674 _GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
675 # endif
676 _GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
677 # endif
678 _GL_CXXALIASWARN (fpurge);
679 #elif defined GNULIB_POSIXCHECK
680 # undef fpurge
681 # if HAVE_RAW_DECL_FPURGE
682 _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
683 "use gnulib module fpurge for portability");
684 # endif
685 #endif
686
687 #if 1
688 # if 0 && (0 || 0)
689 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
690 # undef fputc
691 # define fputc rpl_fputc
692 # endif
693 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
694 _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
695 # else
696 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
697 # endif
698 _GL_CXXALIASWARN (fputc);
699 #endif
700
701 #if 1
702 # if 0 && (0 || 0)
703 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
704 # undef fputs
705 # define fputs rpl_fputs
706 # endif
707 _GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
708 _GL_ARG_NONNULL ((1, 2)));
709 _GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
710 # else
711 _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
712 # endif
713 _GL_CXXALIASWARN (fputs);
714 #endif
715
716 #if 1
717 # if 0 && 0
718 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
719 # undef fread
720 # define fread rpl_fread
721 # endif
722 _GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
723 _GL_ARG_NONNULL ((4)));
724 _GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
725 # else
726 _GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
727 # endif
728 _GL_CXXALIASWARN (fread);
729 #endif
730
731 #if 0
732 # if 0
733 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
734 # undef freopen
735 # define freopen rpl_freopen
736 # endif
737 _GL_FUNCDECL_RPL (freopen, FILE *,
738 (const char *filename, const char *mode, FILE *stream)
739 _GL_ARG_NONNULL ((2, 3)));
740 _GL_CXXALIAS_RPL (freopen, FILE *,
741 (const char *filename, const char *mode, FILE *stream));
742 # else
743 _GL_CXXALIAS_SYS (freopen, FILE *,
744 (const char *filename, const char *mode, FILE *stream));
745 # endif
746 _GL_CXXALIASWARN (freopen);
747 #elif defined GNULIB_POSIXCHECK
748 # undef freopen
749 /* Assume freopen is always declared. */
750 _GL_WARN_ON_USE (freopen,
751 "freopen on native Windows platforms is not POSIX compliant - "
752 "use gnulib module freopen for portability");
753 #endif
754
755 #if 1
756 # if 0 && 0
757 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
758 # undef fscanf
759 # define fscanf rpl_fscanf
760 # endif
761 _GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
762 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
763 _GL_ARG_NONNULL ((1, 2)));
764 _GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
765 # else
766 _GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
767 # endif
768 _GL_CXXALIASWARN (fscanf);
769 #endif
770
771
772 /* Set up the following warnings, based on which modules are in use.
773 GNU Coding Standards discourage the use of fseek, since it imposes
774 an arbitrary limitation on some 32-bit hosts. Remember that the
775 fseek module depends on the fseeko module, so we only have three
776 cases to consider:
777
778 1. The developer is not using either module. Issue a warning under
779 GNULIB_POSIXCHECK for both functions, to remind them that both
780 functions have bugs on some systems. _GL_NO_LARGE_FILES has no
781 impact on this warning.
782
783 2. The developer is using both modules. They may be unaware of the
784 arbitrary limitations of fseek, so issue a warning under
785 GNULIB_POSIXCHECK. On the other hand, they may be using both
786 modules intentionally, so the developer can define
787 _GL_NO_LARGE_FILES in the compilation units where the use of fseek
788 is safe, to silence the warning.
789
790 3. The developer is using the fseeko module, but not fseek. Gnulib
791 guarantees that fseek will still work around platform bugs in that
792 case, but we presume that the developer is aware of the pitfalls of
793 fseek and was trying to avoid it, so issue a warning even when
794 GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
795 defined to silence the warning in particular compilation units.
796 In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
797 fseek gets defined as a macro, it is recommended that the developer
798 uses the fseek module, even if he is not calling the fseek function.
799
800 Most gnulib clients that perform stream operations should fall into
801 category 3. */
802
803 #if 0
804 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
805 # define _GL_FSEEK_WARN /* Category 2, above. */
806 # undef fseek
807 # endif
808 # if 0
809 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
810 # undef fseek
811 # define fseek rpl_fseek
812 # endif
813 _GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
814 _GL_ARG_NONNULL ((1)));
815 _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
816 # else
817 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
818 # endif
819 _GL_CXXALIASWARN (fseek);
820 #endif
821
822 #if 0
823 # if !0 && !defined _GL_NO_LARGE_FILES
824 # define _GL_FSEEK_WARN /* Category 3, above. */
825 # undef fseek
826 # endif
827 # if 0
828 /* Provide an fseeko function that is aware of a preceding fflush(), and which
829 detects pipes. */
830 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
831 # undef fseeko
832 # define fseeko rpl_fseeko
833 # endif
834 _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
835 _GL_ARG_NONNULL ((1)));
836 _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
837 # else
838 # if ! 1
839 _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
840 _GL_ARG_NONNULL ((1)));
841 # endif
842 _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
843 # endif
844 _GL_CXXALIASWARN (fseeko);
845 #elif defined GNULIB_POSIXCHECK
846 # define _GL_FSEEK_WARN /* Category 1, above. */
847 # undef fseek
848 # undef fseeko
849 # if HAVE_RAW_DECL_FSEEKO
850 _GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
851 "use gnulib module fseeko for portability");
852 # endif
853 #endif
854
855 #ifdef _GL_FSEEK_WARN
856 # undef _GL_FSEEK_WARN
857 /* Here, either fseek is undefined (but C89 guarantees that it is
858 declared), or it is defined as rpl_fseek (declared above). */
859 _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
860 "on 32-bit platforms - "
861 "use fseeko function for handling of large files");
862 #endif
863
864
865 /* ftell, ftello. See the comments on fseek/fseeko. */
866
867 #if 0
868 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
869 # define _GL_FTELL_WARN /* Category 2, above. */
870 # undef ftell
871 # endif
872 # if 0
873 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
874 # undef ftell
875 # define ftell rpl_ftell
876 # endif
877 _GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
878 _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
879 # else
880 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
881 # endif
882 _GL_CXXALIASWARN (ftell);
883 #endif
884
885 #if 0
886 # if !0 && !defined _GL_NO_LARGE_FILES
887 # define _GL_FTELL_WARN /* Category 3, above. */
888 # undef ftell
889 # endif
890 # if 0
891 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
892 # undef ftello
893 # define ftello rpl_ftello
894 # endif
895 _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
896 _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
897 # else
898 # if ! 1
899 _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
900 # endif
901 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
902 # endif
903 _GL_CXXALIASWARN (ftello);
904 #elif defined GNULIB_POSIXCHECK
905 # define _GL_FTELL_WARN /* Category 1, above. */
906 # undef ftell
907 # undef ftello
908 # if HAVE_RAW_DECL_FTELLO
909 _GL_WARN_ON_USE (ftello, "ftello is unportable - "
910 "use gnulib module ftello for portability");
911 # endif
912 #endif
913
914 #ifdef _GL_FTELL_WARN
915 # undef _GL_FTELL_WARN
916 /* Here, either ftell is undefined (but C89 guarantees that it is
917 declared), or it is defined as rpl_ftell (declared above). */
918 _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
919 "on 32-bit platforms - "
920 "use ftello function for handling of large files");
921 #endif
922
923
924 #if 1
925 # if 0 && (0 || 0)
926 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
927 # undef fwrite
928 # define fwrite rpl_fwrite
929 # endif
930 _GL_FUNCDECL_RPL (fwrite, size_t,
931 (const void *ptr, size_t s, size_t n, FILE *stream)
932 _GL_ARG_NONNULL ((1, 4)));
933 _GL_CXXALIAS_RPL (fwrite, size_t,
934 (const void *ptr, size_t s, size_t n, FILE *stream));
935 # else
936 _GL_CXXALIAS_SYS (fwrite, size_t,
937 (const void *ptr, size_t s, size_t n, FILE *stream));
938
939 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
940 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
941 which sometimes causes an unwanted diagnostic for fwrite calls.
942 This affects only function declaration attributes under certain
943 versions of gcc and clang, and is not needed for C++. */
944 # if (0 < __USE_FORTIFY_LEVEL \
945 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
946 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
947 && !defined __cplusplus)
948 # undef fwrite
949 # undef fwrite_unlocked
950 extern size_t __REDIRECT (rpl_fwrite,
951 (const void *__restrict, size_t, size_t,
952 FILE *__restrict),
953 fwrite);
954 extern size_t __REDIRECT (rpl_fwrite_unlocked,
955 (const void *__restrict, size_t, size_t,
956 FILE *__restrict),
957 fwrite_unlocked);
958 # define fwrite rpl_fwrite
959 # define fwrite_unlocked rpl_fwrite_unlocked
960 # endif
961 # endif
962 _GL_CXXALIASWARN (fwrite);
963 #endif
964
965 #if 1
966 # if 0 && 0
967 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
968 # undef getc
969 # define getc rpl_fgetc
970 # endif
971 _GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
972 _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
973 # else
974 _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
975 # endif
976 _GL_CXXALIASWARN (getc);
977 #endif
978
979 #if 1
980 # if 0 && 0
981 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
982 # undef getchar
983 # define getchar rpl_getchar
984 # endif
985 _GL_FUNCDECL_RPL (getchar, int, (void));
986 _GL_CXXALIAS_RPL (getchar, int, (void));
987 # else
988 _GL_CXXALIAS_SYS (getchar, int, (void));
989 # endif
990 _GL_CXXALIASWARN (getchar);
991 #endif
992
993 #if 0
994 /* Read input, up to (and including) the next occurrence of DELIMITER, from
995 STREAM, store it in *LINEPTR (and NUL-terminate it).
996 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
997 bytes of space. It is realloc'd as necessary.
998 Return the number of bytes read and stored at *LINEPTR (not including the
999 NUL terminator), or -1 on error or EOF. */
1000 # if 0
1001 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1002 # undef getdelim
1003 # define getdelim rpl_getdelim
1004 # endif
1005 _GL_FUNCDECL_RPL (getdelim, ssize_t,
1006 (char **lineptr, size_t *linesize, int delimiter,
1007 FILE *stream)
1008 _GL_ARG_NONNULL ((1, 2, 4)));
1009 _GL_CXXALIAS_RPL (getdelim, ssize_t,
1010 (char **lineptr, size_t *linesize, int delimiter,
1011 FILE *stream));
1012 # else
1013 # if !1
1014 _GL_FUNCDECL_SYS (getdelim, ssize_t,
1015 (char **lineptr, size_t *linesize, int delimiter,
1016 FILE *stream)
1017 _GL_ARG_NONNULL ((1, 2, 4)));
1018 # endif
1019 _GL_CXXALIAS_SYS (getdelim, ssize_t,
1020 (char **lineptr, size_t *linesize, int delimiter,
1021 FILE *stream));
1022 # endif
1023 _GL_CXXALIASWARN (getdelim);
1024 #elif defined GNULIB_POSIXCHECK
1025 # undef getdelim
1026 # if HAVE_RAW_DECL_GETDELIM
1027 _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
1028 "use gnulib module getdelim for portability");
1029 # endif
1030 #endif
1031
1032 #if 0
1033 /* Read a line, up to (and including) the next newline, from STREAM, store it
1034 in *LINEPTR (and NUL-terminate it).
1035 *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
1036 bytes of space. It is realloc'd as necessary.
1037 Return the number of bytes read and stored at *LINEPTR (not including the
1038 NUL terminator), or -1 on error or EOF. */
1039 # if 0
1040 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1041 # undef getline
1042 # define getline rpl_getline
1043 # endif
1044 _GL_FUNCDECL_RPL (getline, ssize_t,
1045 (char **lineptr, size_t *linesize, FILE *stream)
1046 _GL_ARG_NONNULL ((1, 2, 3)));
1047 _GL_CXXALIAS_RPL (getline, ssize_t,
1048 (char **lineptr, size_t *linesize, FILE *stream));
1049 # else
1050 # if !1
1051 _GL_FUNCDECL_SYS (getline, ssize_t,
1052 (char **lineptr, size_t *linesize, FILE *stream)
1053 _GL_ARG_NONNULL ((1, 2, 3)));
1054 # endif
1055 _GL_CXXALIAS_SYS (getline, ssize_t,
1056 (char **lineptr, size_t *linesize, FILE *stream));
1057 # endif
1058 # if 1
1059 _GL_CXXALIASWARN (getline);
1060 # endif
1061 #elif defined GNULIB_POSIXCHECK
1062 # undef getline
1063 # if HAVE_RAW_DECL_GETLINE
1064 _GL_WARN_ON_USE (getline, "getline is unportable - "
1065 "use gnulib module getline for portability");
1066 # endif
1067 #endif
1068
1069 /* It is very rare that the developer ever has full control of stdin,
1070 so any use of gets warrants an unconditional warning; besides, C11
1071 removed it. */
1072 #undef gets
1073 #if HAVE_RAW_DECL_GETS && !defined __cplusplus
1074 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
1075 #endif
1076
1077 #if 0 || 0
1078 struct obstack;
1079 /* Grow an obstack with formatted output. Return the number of
1080 bytes added to OBS. No trailing nul byte is added, and the
1081 object should be closed with obstack_finish before use. Upon
1082 memory allocation error, call obstack_alloc_failed_handler. Upon
1083 other error, return -1. */
1084 # if 0
1085 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1086 # define obstack_printf rpl_obstack_printf
1087 # endif
1088 _GL_FUNCDECL_RPL (obstack_printf, int,
1089 (struct obstack *obs, const char *format, ...)
1090 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1091 _GL_ARG_NONNULL ((1, 2)));
1092 _GL_CXXALIAS_RPL (obstack_printf, int,
1093 (struct obstack *obs, const char *format, ...));
1094 # else
1095 # if !1
1096 _GL_FUNCDECL_SYS (obstack_printf, int,
1097 (struct obstack *obs, const char *format, ...)
1098 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1099 _GL_ARG_NONNULL ((1, 2)));
1100 # endif
1101 _GL_CXXALIAS_SYS (obstack_printf, int,
1102 (struct obstack *obs, const char *format, ...));
1103 # endif
1104 _GL_CXXALIASWARN (obstack_printf);
1105 # if 0
1106 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1107 # define obstack_vprintf rpl_obstack_vprintf
1108 # endif
1109 _GL_FUNCDECL_RPL (obstack_vprintf, int,
1110 (struct obstack *obs, const char *format, va_list args)
1111 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1112 _GL_ARG_NONNULL ((1, 2)));
1113 _GL_CXXALIAS_RPL (obstack_vprintf, int,
1114 (struct obstack *obs, const char *format, va_list args));
1115 # else
1116 # if !1
1117 _GL_FUNCDECL_SYS (obstack_vprintf, int,
1118 (struct obstack *obs, const char *format, va_list args)
1119 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1120 _GL_ARG_NONNULL ((1, 2)));
1121 # endif
1122 _GL_CXXALIAS_SYS (obstack_vprintf, int,
1123 (struct obstack *obs, const char *format, va_list args));
1124 # endif
1125 _GL_CXXALIASWARN (obstack_vprintf);
1126 #endif
1127
1128 #if 0
1129 # if !1
1130 _GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
1131 # endif
1132 _GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
1133 _GL_CXXALIASWARN (pclose);
1134 #elif defined GNULIB_POSIXCHECK
1135 # undef pclose
1136 # if HAVE_RAW_DECL_PCLOSE
1137 _GL_WARN_ON_USE (pclose, "pclose is unportable - "
1138 "use gnulib module pclose for more portability");
1139 # endif
1140 #endif
1141
1142 #if 0
1143 /* Print a message to standard error, describing the value of ERRNO,
1144 (if STRING is not NULL and not empty) prefixed with STRING and ": ",
1145 and terminated with a newline. */
1146 # if 0
1147 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1148 # define perror rpl_perror
1149 # endif
1150 _GL_FUNCDECL_RPL (perror, void, (const char *string));
1151 _GL_CXXALIAS_RPL (perror, void, (const char *string));
1152 # else
1153 _GL_CXXALIAS_SYS (perror, void, (const char *string));
1154 # endif
1155 _GL_CXXALIASWARN (perror);
1156 #elif defined GNULIB_POSIXCHECK
1157 # undef perror
1158 /* Assume perror is always declared. */
1159 _GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
1160 "use gnulib module perror for portability");
1161 #endif
1162
1163 #if 0
1164 # if 0
1165 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1166 # undef popen
1167 # define popen rpl_popen
1168 # endif
1169 _GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
1170 _GL_ARG_NONNULL ((1, 2)));
1171 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
1172 # else
1173 # if !1
1174 _GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
1175 _GL_ARG_NONNULL ((1, 2)));
1176 # endif
1177 _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
1178 # endif
1179 _GL_CXXALIASWARN (popen);
1180 #elif defined GNULIB_POSIXCHECK
1181 # undef popen
1182 # if HAVE_RAW_DECL_POPEN
1183 _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
1184 "use gnulib module popen or pipe for more portability");
1185 # endif
1186 #endif
1187
1188 #if 0 || 1
1189 # if (0 && 0) \
1190 || (1 && 0 && (0 || 0))
1191 # if defined __GNUC__
1192 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1193 /* Don't break __attribute__((format(printf,M,N))). */
1194 # define printf __printf__
1195 # endif
1196 # if 0 || 0
1197 _GL_FUNCDECL_RPL_1 (__printf__, int,
1198 (const char *format, ...)
1199 __asm__ (
1200 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
1201 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
1202 _GL_ARG_NONNULL ((1)));
1203 # else
1204 _GL_FUNCDECL_RPL_1 (__printf__, int,
1205 (const char *format, ...)
1206 __asm__ (
1207 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
1208 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
1209 _GL_ARG_NONNULL ((1)));
1210 # endif
1211 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
1212 # else
1213 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1214 # define printf rpl_printf
1215 # endif
1216 _GL_FUNCDECL_RPL (printf, int,
1217 (const char *format, ...)
1218 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
1219 _GL_ARG_NONNULL ((1)));
1220 _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
1221 # endif
1222 # define GNULIB_overrides_printf 1
1223 # else
1224 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
1225 # endif
1226 _GL_CXXALIASWARN (printf);
1227 #endif
1228 #if !0 && defined GNULIB_POSIXCHECK
1229 # if !GNULIB_overrides_printf
1230 # undef printf
1231 # endif
1232 /* Assume printf is always declared. */
1233 _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
1234 "use gnulib module printf-posix for portable "
1235 "POSIX compliance");
1236 #endif
1237
1238 #if 1
1239 # if 0 && (0 || 0)
1240 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1241 # undef putc
1242 # define putc rpl_fputc
1243 # endif
1244 _GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
1245 _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
1246 # else
1247 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
1248 # endif
1249 _GL_CXXALIASWARN (putc);
1250 #endif
1251
1252 #if 1
1253 # if 0 && (0 || 0)
1254 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1255 # undef putchar
1256 # define putchar rpl_putchar
1257 # endif
1258 _GL_FUNCDECL_RPL (putchar, int, (int c));
1259 _GL_CXXALIAS_RPL (putchar, int, (int c));
1260 # else
1261 _GL_CXXALIAS_SYS (putchar, int, (int c));
1262 # endif
1263 _GL_CXXALIASWARN (putchar);
1264 #endif
1265
1266 #if 1
1267 # if 0 && (0 || 0)
1268 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1269 # undef puts
1270 # define puts rpl_puts
1271 # endif
1272 _GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
1273 _GL_CXXALIAS_RPL (puts, int, (const char *string));
1274 # else
1275 _GL_CXXALIAS_SYS (puts, int, (const char *string));
1276 # endif
1277 _GL_CXXALIASWARN (puts);
1278 #endif
1279
1280 #if 0
1281 # if 0
1282 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1283 # undef remove
1284 # define remove rpl_remove
1285 # endif
1286 _GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
1287 _GL_CXXALIAS_RPL (remove, int, (const char *name));
1288 # else
1289 _GL_CXXALIAS_SYS (remove, int, (const char *name));
1290 # endif
1291 _GL_CXXALIASWARN (remove);
1292 #elif defined GNULIB_POSIXCHECK
1293 # undef remove
1294 /* Assume remove is always declared. */
1295 _GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
1296 "use gnulib module remove for more portability");
1297 #endif
1298
1299 #if 1
1300 # if 0
1301 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1302 # undef rename
1303 # define rename rpl_rename
1304 # endif
1305 _GL_FUNCDECL_RPL (rename, int,
1306 (const char *old_filename, const char *new_filename)
1307 _GL_ARG_NONNULL ((1, 2)));
1308 _GL_CXXALIAS_RPL (rename, int,
1309 (const char *old_filename, const char *new_filename));
1310 # else
1311 _GL_CXXALIAS_SYS (rename, int,
1312 (const char *old_filename, const char *new_filename));
1313 # endif
1314 _GL_CXXALIASWARN (rename);
1315 #elif defined GNULIB_POSIXCHECK
1316 # undef rename
1317 /* Assume rename is always declared. */
1318 _GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
1319 "use gnulib module rename for more portability");
1320 #endif
1321
1322 #if 0
1323 # if 0
1324 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1325 # undef renameat
1326 # define renameat rpl_renameat
1327 # endif
1328 _GL_FUNCDECL_RPL (renameat, int,
1329 (int fd1, char const *file1, int fd2, char const *file2)
1330 _GL_ARG_NONNULL ((2, 4)));
1331 _GL_CXXALIAS_RPL (renameat, int,
1332 (int fd1, char const *file1, int fd2, char const *file2));
1333 # else
1334 # if !1
1335 _GL_FUNCDECL_SYS (renameat, int,
1336 (int fd1, char const *file1, int fd2, char const *file2)
1337 _GL_ARG_NONNULL ((2, 4)));
1338 # endif
1339 _GL_CXXALIAS_SYS (renameat, int,
1340 (int fd1, char const *file1, int fd2, char const *file2));
1341 # endif
1342 _GL_CXXALIASWARN (renameat);
1343 #elif defined GNULIB_POSIXCHECK
1344 # undef renameat
1345 # if HAVE_RAW_DECL_RENAMEAT
1346 _GL_WARN_ON_USE (renameat, "renameat is not portable - "
1347 "use gnulib module renameat for portability");
1348 # endif
1349 #endif
1350
1351 #if 1
1352 # if 0 && 0
1353 # if defined __GNUC__
1354 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1355 # undef scanf
1356 /* Don't break __attribute__((format(scanf,M,N))). */
1357 # define scanf __scanf__
1358 # endif
1359 _GL_FUNCDECL_RPL_1 (__scanf__, int,
1360 (const char *format, ...)
1361 __asm__ (
1362 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
1363 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1364 _GL_ARG_NONNULL ((1)));
1365 _GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
1366 # else
1367 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1368 # undef scanf
1369 # define scanf rpl_scanf
1370 # endif
1371 _GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
1372 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1373 _GL_ARG_NONNULL ((1)));
1374 _GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
1375 # endif
1376 # else
1377 _GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
1378 # endif
1379 _GL_CXXALIASWARN (scanf);
1380 #endif
1381
1382 #if 0
1383 # if 0
1384 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1385 # define snprintf rpl_snprintf
1386 # endif
1387 _GL_FUNCDECL_RPL (snprintf, int,
1388 (char *str, size_t size, const char *format, ...)
1389 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1390 _GL_ARG_NONNULL ((3)));
1391 _GL_CXXALIAS_RPL (snprintf, int,
1392 (char *str, size_t size, const char *format, ...));
1393 # else
1394 # if !1
1395 _GL_FUNCDECL_SYS (snprintf, int,
1396 (char *str, size_t size, const char *format, ...)
1397 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1398 _GL_ARG_NONNULL ((3)));
1399 # endif
1400 _GL_CXXALIAS_SYS (snprintf, int,
1401 (char *str, size_t size, const char *format, ...));
1402 # endif
1403 _GL_CXXALIASWARN (snprintf);
1404 #elif defined GNULIB_POSIXCHECK
1405 # undef snprintf
1406 # if HAVE_RAW_DECL_SNPRINTF
1407 _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1408 "use gnulib module snprintf for portability");
1409 # endif
1410 #endif
1411
1412 /* Some people would argue that all sprintf uses should be warned about
1413 (for example, OpenBSD issues a link warning for it),
1414 since it can cause security holes due to buffer overruns.
1415 However, we believe that sprintf can be used safely, and is more
1416 efficient than snprintf in those safe cases; and as proof of our
1417 belief, we use sprintf in several gnulib modules. So this header
1418 intentionally avoids adding a warning to sprintf except when
1419 GNULIB_POSIXCHECK is defined. */
1420
1421 #if 0
1422 # if 0
1423 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1424 # define sprintf rpl_sprintf
1425 # endif
1426 _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
1427 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1428 _GL_ARG_NONNULL ((1, 2)));
1429 _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
1430 # else
1431 _GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
1432 # endif
1433 _GL_CXXALIASWARN (sprintf);
1434 #elif defined GNULIB_POSIXCHECK
1435 # undef sprintf
1436 /* Assume sprintf is always declared. */
1437 _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
1438 "use gnulib module sprintf-posix for portable "
1439 "POSIX compliance");
1440 #endif
1441
1442 #if 0
1443 # if 0
1444 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1445 # define tmpfile rpl_tmpfile
1446 # endif
1447 _GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
1448 _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
1449 # else
1450 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
1451 # endif
1452 _GL_CXXALIASWARN (tmpfile);
1453 #elif defined GNULIB_POSIXCHECK
1454 # undef tmpfile
1455 # if HAVE_RAW_DECL_TMPFILE
1456 _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
1457 "use gnulib module tmpfile for portability");
1458 # endif
1459 #endif
1460
1461 #if 0
1462 /* Write formatted output to a string dynamically allocated with malloc().
1463 If the memory allocation succeeds, store the address of the string in
1464 *RESULT and return the number of resulting bytes, excluding the trailing
1465 NUL. Upon memory allocation error, or some other error, return -1. */
1466 # if 0
1467 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1468 # define asprintf rpl_asprintf
1469 # endif
1470 _GL_FUNCDECL_RPL (asprintf, int,
1471 (char **result, const char *format, ...)
1472 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1473 _GL_ARG_NONNULL ((1, 2)));
1474 _GL_CXXALIAS_RPL (asprintf, int,
1475 (char **result, const char *format, ...));
1476 # else
1477 # if !1
1478 _GL_FUNCDECL_SYS (asprintf, int,
1479 (char **result, const char *format, ...)
1480 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1481 _GL_ARG_NONNULL ((1, 2)));
1482 # endif
1483 _GL_CXXALIAS_SYS (asprintf, int,
1484 (char **result, const char *format, ...));
1485 # endif
1486 _GL_CXXALIASWARN (asprintf);
1487 # if 0
1488 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1489 # define vasprintf rpl_vasprintf
1490 # endif
1491 _GL_FUNCDECL_RPL (vasprintf, int,
1492 (char **result, const char *format, va_list args)
1493 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1494 _GL_ARG_NONNULL ((1, 2)));
1495 _GL_CXXALIAS_RPL (vasprintf, int,
1496 (char **result, const char *format, va_list args));
1497 # else
1498 # if !1
1499 _GL_FUNCDECL_SYS (vasprintf, int,
1500 (char **result, const char *format, va_list args)
1501 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1502 _GL_ARG_NONNULL ((1, 2)));
1503 # endif
1504 _GL_CXXALIAS_SYS (vasprintf, int,
1505 (char **result, const char *format, va_list args));
1506 # endif
1507 _GL_CXXALIASWARN (vasprintf);
1508 #endif
1509
1510 #if 0
1511 # if 0
1512 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1513 # define vdprintf rpl_vdprintf
1514 # endif
1515 _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
1516 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1517 _GL_ARG_NONNULL ((2)));
1518 _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
1519 # else
1520 # if !1
1521 _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
1522 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1523 _GL_ARG_NONNULL ((2)));
1524 # endif
1525 /* Need to cast, because on Solaris, the third parameter will likely be
1526 __va_list args. */
1527 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
1528 (int fd, const char *format, va_list args));
1529 # endif
1530 _GL_CXXALIASWARN (vdprintf);
1531 #elif defined GNULIB_POSIXCHECK
1532 # undef vdprintf
1533 # if HAVE_RAW_DECL_VDPRINTF
1534 _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
1535 "use gnulib module vdprintf for portability");
1536 # endif
1537 #endif
1538
1539 #if 0 || 1
1540 # if (0 && 0) \
1541 || (1 && 0 && (0 || 0))
1542 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1543 # define vfprintf rpl_vfprintf
1544 # endif
1545 # define GNULIB_overrides_vfprintf 1
1546 # if 0
1547 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
1548 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1549 _GL_ARG_NONNULL ((1, 2)));
1550 # else
1551 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
1552 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
1553 _GL_ARG_NONNULL ((1, 2)));
1554 # endif
1555 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
1556 # else
1557 /* Need to cast, because on Solaris, the third parameter is
1558 __va_list args
1559 and GCC's fixincludes did not change this to __gnuc_va_list. */
1560 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
1561 (FILE *fp, const char *format, va_list args));
1562 # endif
1563 _GL_CXXALIASWARN (vfprintf);
1564 #endif
1565 #if !0 && defined GNULIB_POSIXCHECK
1566 # if !GNULIB_overrides_vfprintf
1567 # undef vfprintf
1568 # endif
1569 /* Assume vfprintf is always declared. */
1570 _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
1571 "use gnulib module vfprintf-posix for portable "
1572 "POSIX compliance");
1573 #endif
1574
1575 #if 0
1576 # if 0 && 0
1577 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1578 # undef vfscanf
1579 # define vfscanf rpl_vfscanf
1580 # endif
1581 _GL_FUNCDECL_RPL (vfscanf, int,
1582 (FILE *stream, const char *format, va_list args)
1583 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
1584 _GL_ARG_NONNULL ((1, 2)));
1585 _GL_CXXALIAS_RPL (vfscanf, int,
1586 (FILE *stream, const char *format, va_list args));
1587 # else
1588 _GL_CXXALIAS_SYS (vfscanf, int,
1589 (FILE *stream, const char *format, va_list args));
1590 # endif
1591 _GL_CXXALIASWARN (vfscanf);
1592 #endif
1593
1594 #if 0 || 1
1595 # if (0 && 0) \
1596 || (1 && 0 && (0 || 0))
1597 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1598 # define vprintf rpl_vprintf
1599 # endif
1600 # define GNULIB_overrides_vprintf 1
1601 # if 0 || 0
1602 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
1603 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
1604 _GL_ARG_NONNULL ((1)));
1605 # else
1606 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
1607 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
1608 _GL_ARG_NONNULL ((1)));
1609 # endif
1610 _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
1611 # else
1612 /* Need to cast, because on Solaris, the second parameter is
1613 __va_list args
1614 and GCC's fixincludes did not change this to __gnuc_va_list. */
1615 _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
1616 # endif
1617 _GL_CXXALIASWARN (vprintf);
1618 #endif
1619 #if !0 && defined GNULIB_POSIXCHECK
1620 # if !GNULIB_overrides_vprintf
1621 # undef vprintf
1622 # endif
1623 /* Assume vprintf is always declared. */
1624 _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
1625 "use gnulib module vprintf-posix for portable "
1626 "POSIX compliance");
1627 #endif
1628
1629 #if 0
1630 # if 0 && 0
1631 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1632 # undef vscanf
1633 # define vscanf rpl_vscanf
1634 # endif
1635 _GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
1636 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
1637 _GL_ARG_NONNULL ((1)));
1638 _GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
1639 # else
1640 _GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
1641 # endif
1642 _GL_CXXALIASWARN (vscanf);
1643 #endif
1644
1645 #if 0
1646 # if 0
1647 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1648 # define vsnprintf rpl_vsnprintf
1649 # endif
1650 _GL_FUNCDECL_RPL (vsnprintf, int,
1651 (char *str, size_t size, const char *format, va_list args)
1652 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1653 _GL_ARG_NONNULL ((3)));
1654 _GL_CXXALIAS_RPL (vsnprintf, int,
1655 (char *str, size_t size, const char *format, va_list args));
1656 # else
1657 # if !1
1658 _GL_FUNCDECL_SYS (vsnprintf, int,
1659 (char *str, size_t size, const char *format, va_list args)
1660 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1661 _GL_ARG_NONNULL ((3)));
1662 # endif
1663 _GL_CXXALIAS_SYS (vsnprintf, int,
1664 (char *str, size_t size, const char *format, va_list args));
1665 # endif
1666 _GL_CXXALIASWARN (vsnprintf);
1667 #elif defined GNULIB_POSIXCHECK
1668 # undef vsnprintf
1669 # if HAVE_RAW_DECL_VSNPRINTF
1670 _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1671 "use gnulib module vsnprintf for portability");
1672 # endif
1673 #endif
1674
1675 #if 0
1676 # if 0
1677 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1678 # define vsprintf rpl_vsprintf
1679 # endif
1680 _GL_FUNCDECL_RPL (vsprintf, int,
1681 (char *str, const char *format, va_list args)
1682 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1683 _GL_ARG_NONNULL ((1, 2)));
1684 _GL_CXXALIAS_RPL (vsprintf, int,
1685 (char *str, const char *format, va_list args));
1686 # else
1687 /* Need to cast, because on Solaris, the third parameter is
1688 __va_list args
1689 and GCC's fixincludes did not change this to __gnuc_va_list. */
1690 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
1691 (char *str, const char *format, va_list args));
1692 # endif
1693 _GL_CXXALIASWARN (vsprintf);
1694 #elif defined GNULIB_POSIXCHECK
1695 # undef vsprintf
1696 /* Assume vsprintf is always declared. */
1697 _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
1698 "use gnulib module vsprintf-posix for portable "
1699 "POSIX compliance");
1700 #endif
1701
1702 #endif /* _GL_STDIO_H */
1703 #endif /* _GL_STDIO_H */
1704 #endif
types.h
_GL_ARG_NONNULL
#define _GL_ARG_NONNULL(params)
Definition: stdio.h:423
fp
static const struct aarch64_register fp
Definition: linux-aarch64-low.c:629
_GL_CXXALIAS_RPL
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: stdio.h:234
_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM
#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument)
Definition: stdio.h:92
_GL_ATTRIBUTE_FORMAT_PRINTF
#define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument)
Definition: stdio.h:80
delimiter
char delimiter
Definition: gdb_vecs.h:38
name
const char * name
Definition: tracepoint.c:180
perror
void perror(const char *)
Definition: wincecompat.c:24
vasprintf
int vasprintf(char **strp, const char *fmt, va_list ap)
_GL_CXXALIAS_SYS_CAST
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
Definition: stdio.h:322
_GL_CXXALIAS_SYS
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: stdio.h:299
_GL_CXXALIASWARN
#define _GL_CXXALIASWARN(func)
Definition: stdio.h:381
offset
int offset
Definition: tracepoint.c:181
unistd.h
_GL_WARN_ON_USE
#define _GL_WARN_ON_USE(function, message)
Definition: stdio.h:439
vsnprintf
int vsnprintf(char *str, size_t size, const char *format, va_list ap)
_GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM
#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument)
Definition: stdio.h:112
_GL_STDIO_MACROEXPAND_AND_STRINGIZE
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token)
Definition: stdio.h:477
_GL_FUNCDECL_RPL
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: stdio.h:210
_GL_FUNCDECL_SYS
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: stdio.h:222
_GL_CXXALIAS_RPL_1
#define _GL_CXXALIAS_RPL_1(func, rpl_func, rettype, parameters)
Definition: stdio.h:249
_GL_FUNCDECL_RPL_1
#define _GL_FUNCDECL_RPL_1(rpl_func, rettype, parameters_and_attributes)
Definition: stdio.h:212