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