[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/8] sig2str: port --enable-gcc-warnings to clang
From: |
Paul Eggert |
Subject: |
[PATCH 7/8] sig2str: port --enable-gcc-warnings to clang |
Date: |
Wed, 15 May 2013 00:38:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
* lib/sig2str.c (sig2str): Avoid warning about unused printf argument.
---
ChangeLog | 3 +++
lib/sig2str.c | 12 ++++++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 35a57b4..baa594e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2013-05-15 Paul Eggert <address@hidden>
+ 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.
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 8b36e2f..6ead2a7 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;
}
}
--
1.7.11.7
- Re: [libvirt] [PATCH 4/6] Correctly detect warning flags with clang, Eric Blake, 2013/05/13
- Re: [libvirt] [PATCH 4/6] Correctly detect warning flags with clang, Paul Eggert, 2013/05/15
- [PATCH 2/8] inttostr: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 3/8] malloca: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 4/8] mbsstr: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 5/8] memchr2: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 6/8] obstack: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 7/8] sig2str: port --enable-gcc-warnings to clang,
Paul Eggert <=
- [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Eric Blake, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Paul Eggert, 2013/05/15
- Re: [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Eric Blake, 2013/05/16
- [PATCH 2/4] thread: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 3/4] getaddrinfo-tests: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 4/4] spawn-tests, sys_socket-tests, sys_wait-tests: port to clang, Paul Eggert, 2013/05/15