comparison lib/stdio.in.h @ 17264:66e6219b0ff0

fwrite: silence __wur only for older glibc versions * lib/stdio.in.h (fwrite): Limit workaround to glibc 2.4 through 2.15. This will help us remove this workaround some time in the far future.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 03 Jan 2013 10:11:25 -0800
parents 283c189edcab
children 30110a025c48 c4e1bb6e391b
comparison
equal deleted inserted replaced
17263:283c189edcab 17264:66e6219b0ff0
573 (const void *ptr, size_t s, size_t n, FILE *stream)); 573 (const void *ptr, size_t s, size_t n, FILE *stream));
574 # else 574 # else
575 _GL_CXXALIAS_SYS (fwrite, size_t, 575 _GL_CXXALIAS_SYS (fwrite, size_t,
576 (const void *ptr, size_t s, size_t n, FILE *stream)); 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 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, 579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
580 which sometimes causes an unwanted diagnostic for fwrite calls. 580 which sometimes causes an unwanted diagnostic for fwrite calls.
581 This affects only function declaration attributes under certain 581 This affects only function declaration attributes under certain
582 versions of gcc, and is not needed for C++. */ 582 versions of gcc, and is not needed for C++. */
583 # if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL \ 583 # if (0 < __USE_FORTIFY_LEVEL \
584 && 3 < (__GNUC__ + (4 <= __GNUC_MINOR__)) 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586 && !defined __cplusplus)
585 # undef fwrite 587 # undef fwrite
586 # define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) 588 # define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
587 # endif 589 # endif
588 # endif 590 # endif
589 _GL_CXXALIASWARN (fwrite); 591 _GL_CXXALIASWARN (fwrite);