1
1
/* A GNU-like <stdio.h>.
3
Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
3
Copyright (C) 2004, 2007-2013 Free Software Foundation, Inc.
5
5
This program is free software; you can redistribute it and/or modify
6
6
it under the terms of the GNU General Public License as published by
575
575
_GL_CXXALIAS_SYS (fwrite, size_t,
576
576
(const void *ptr, size_t s, size_t n, FILE *stream));
578
/* Work around glibc bug 11959
578
/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
579
579
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
580
580
which sometimes causes an unwanted diagnostic for fwrite calls.
581
This affects only function declaration attributes, so it's not
583
# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
584
static inline size_t _GL_ARG_NONNULL ((1, 4))
585
rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
587
size_t r = fwrite (ptr, s, n, stream);
581
This affects only function declaration attributes under certain
582
versions of gcc, and is not needed for C++. */
583
# if (0 < __USE_FORTIFY_LEVEL \
584
&& __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585
&& 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586
&& !defined __cplusplus)
592
# define fwrite rpl_fwrite
588
# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
595
591
_GL_CXXALIASWARN (fwrite);