aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2013-05-16 00:10:39 -0700
committerPaul Eggert2013-05-16 00:10:39 -0700
commitcdd0de4b056b4612e055fa15f65af118dafc9b18 (patch)
treea9d72533fb38b82969308316c958a3263d85d10d /lib
parent9df4ec5e9044e92e792ba9e8cb714603e32c5cc5 (diff)
downloademacs-cdd0de4b056b4612e055fa15f65af118dafc9b18.tar.gz
emacs-cdd0de4b056b4612e055fa15f65af118dafc9b18.zip
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.c12
-rw-r--r--lib/stdio.in.h14
2 files changed, 20 insertions, 6 deletions
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 8b36e2facf0..6ead2a71d13 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -325,21 +325,25 @@ sig2str (int signum, char *signame)
325 { 325 {
326 int rtmin = SIGRTMIN; 326 int rtmin = SIGRTMIN;
327 int rtmax = SIGRTMAX; 327 int rtmax = SIGRTMAX;
328 int base, delta;
328 329
329 if (! (rtmin <= signum && signum <= rtmax)) 330 if (! (rtmin <= signum && signum <= rtmax))
330 return -1; 331 return -1;
331 332
332 if (signum <= rtmin + (rtmax - rtmin) / 2) 333 if (signum <= rtmin + (rtmax - rtmin) / 2)
333 { 334 {
334 int delta = signum - rtmin; 335 strcpy (signame, "RTMIN");
335 sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); 336 base = rtmin;
336 } 337 }
337 else 338 else
338 { 339 {
339 int delta = rtmax - signum; 340 strcpy (signame, "RTMAX");
340 sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); 341 base = rtmax;
341 } 342 }
342 343
344 delta = signum - base;
345 if (delta != 0)
346 sprintf (signame + 5, "%+d", delta);
343 return 0; 347 return 0;
344 } 348 }
345} 349}
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index d6af99ca77d..06cbad00d3d 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
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 clang, and is not needed for C++. */
583# if (0 < __USE_FORTIFY_LEVEL \ 583# if (0 < __USE_FORTIFY_LEVEL \
584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ 585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586 && !defined __cplusplus) 586 && !defined __cplusplus)
587# undef fwrite 587# undef fwrite
588# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) 588# undef fwrite_unlocked
589extern size_t __REDIRECT (rpl_fwrite,
590 (const void *__restrict, size_t, size_t,
591 FILE *__restrict),
592 fwrite);
593extern size_t __REDIRECT (rpl_fwrite_unlocked,
594 (const void *__restrict, size_t, size_t,
595 FILE *__restrict),
596 fwrite_unlocked);
597# define fwrite rpl_fwrite
598# define fwrite_unlocked rpl_fwrite_unlocked
589# endif 599# endif
590# endif 600# endif
591_GL_CXXALIASWARN (fwrite); 601_GL_CXXALIASWARN (fwrite);