diff options
author | Paul Eggert <[email protected]> | 2013-05-16 00:10:39 -0700 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2013-05-16 00:10:39 -0700 |
commit | cdd0de4b056b4612e055fa15f65af118dafc9b18 (patch) | |
tree | a9d72533fb38b82969308316c958a3263d85d10d /lib | |
parent | 9df4ec5e9044e92e792ba9e8cb714603e32c5cc5 (diff) |
Merge from gnulib.
2013-05-15 manywarnings: update for GCC 4.8.0
2013-05-15 stdio: use __REDIRECT for fwrite, fwrite_unlocked
2013-05-15 sig2str, stdio, warnings: port to clang
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sig2str.c | 12 | ||||
-rw-r--r-- | lib/stdio.in.h | 14 |
2 files changed, 20 insertions, 6 deletions
diff --git a/lib/sig2str.c b/lib/sig2str.c index 8b36e2facf..6ead2a71d1 100644 --- a/lib/sig2str.c +++ b/lib/sig2str.c @@ -325,21 +325,25 @@ sig2str (int signum, char *signame) { int rtmin = SIGRTMIN; int rtmax = SIGRTMAX; + int base, delta; if (! (rtmin <= signum && signum <= rtmax)) return -1; if (signum <= rtmin + (rtmax - rtmin) / 2) { - int delta = signum - rtmin; - sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); + strcpy (signame, "RTMIN"); + base = rtmin; } else { - int delta = rtmax - signum; - sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); + strcpy (signame, "RTMAX"); + base = rtmax; } + delta = signum - base; + if (delta != 0) + sprintf (signame + 5, "%+d", delta); return 0; } } diff --git a/lib/stdio.in.h b/lib/stdio.in.h index d6af99ca77..06cbad00d3 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t, <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++. */ + versions of gcc and clang, and is not needed for C++. */ # 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; }) +# undef fwrite_unlocked +extern size_t __REDIRECT (rpl_fwrite, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite); +extern size_t __REDIRECT (rpl_fwrite_unlocked, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite_unlocked); +# define fwrite rpl_fwrite +# define fwrite_unlocked rpl_fwrite_unlocked # endif # endif _GL_CXXALIASWARN (fwrite); |