~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/stdio.in.h

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* A GNU-like <stdio.h>.
2
2
 
3
 
   Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
 
3
   Copyright (C) 2004, 2007-2013 Free Software Foundation, Inc.
4
4
 
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));
577
577
 
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
582
 
   needed for C++.  */
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)
586
 
{
587
 
  size_t r = fwrite (ptr, s, n, stream);
588
 
  (void) r;
589
 
  return r;
590
 
}
 
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)
591
587
#   undef fwrite
592
 
#   define fwrite rpl_fwrite
 
588
#   define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
593
589
#  endif
594
590
# endif
595
591
_GL_CXXALIASWARN (fwrite);
1333
1329
                      "POSIX compliance");
1334
1330
#endif
1335
1331
 
1336
 
 
1337
1332
#endif /* _@GUARD_PREFIX@_STDIO_H */
1338
1333
#endif /* _@GUARD_PREFIX@_STDIO_H */
1339
1334
#endif