diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-01-03 10:11:25 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-01-03 10:11:40 -0800 |
commit | e728a1bedbe018a07f8fcb54661128b14fd17fd0 (patch) | |
tree | 384a3aebb3acd5c4d2dd9b899d978f815d46128c /lib/stdio.in.h | |
parent | 61c7b1e32e11e9e40b4d59ab888a807620befcd3 (diff) | |
download | gnulib-e728a1bedbe018a07f8fcb54661128b14fd17fd0.tar.gz |
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.
Diffstat (limited to 'lib/stdio.in.h')
-rw-r--r-- | lib/stdio.in.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdio.in.h b/lib/stdio.in.h index f9765d100d..c345499a53 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -575,13 +575,15 @@ _GL_CXXALIAS_RPL (fwrite, size_t, _GL_CXXALIAS_SYS (fwrite, size_t, (const void *ptr, size_t s, size_t n, FILE *stream)); -/* Work around glibc bug 11959 +/* Work around bug 11959 when fortifying glibc 2.4 through 2.15 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, which sometimes causes an unwanted diagnostic for fwrite calls. This affects only function declaration attributes under certain versions of gcc, and is not needed for C++. */ -# if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL \ - && 3 < (__GNUC__ + (4 <= __GNUC_MINOR__)) +# if (0 < __USE_FORTIFY_LEVEL \ + && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ + && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ + && !defined __cplusplus) # undef fwrite # define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) # endif |