Mercurial > hg > octave-lyh > gnulib-hg
changeset 17407:b5c1d4b2677e
sig2str: port --enable-gcc-warnings to clang
* lib/sig2str.c (sig2str): Avoid warning about unused printf argument.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 15 May 2013 00:28:44 -0700 |
parents | 253d6bbd7aa4 |
children | c4e1bb6e391b |
files | ChangeLog lib/sig2str.c |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-05-15 Paul Eggert <eggert@cs.ucla.edu> + sig2str: port --enable-gcc-warnings to clang + * lib/sig2str.c (sig2str): Avoid warning about unused printf argument. + obstack: port --enable-gcc-warnings to clang * lib/obstack.h (obstack_ptr_grow_fast, obstack_int_grow_fast): Avoid casts from looser to stricter-aligned pointers.
--- a/lib/sig2str.c +++ b/lib/sig2str.c @@ -325,21 +325,25 @@ { 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; } }