From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha
Date: Sat, 28 Aug 2021 19:41:48 +0200 [thread overview]
Message-ID: <3277819.HovnAMPojK@omega> (raw)
On Linux/alpha, with a testdir of all of gnulib, I see this compilation error:
../../gllib/sigabbrev_np.c: In function 'sigabbrev_np':
../../gllib/sigabbrev_np.c:199:5: error: duplicate case value
199 | case SIGPWR: return "PWR";
| ^~~~
../../gllib/sigabbrev_np.c:135:5: note: previously used here
135 | case SIGINFO: return "INFO";
| ^~~~
make[4]: *** [Makefile:9372: sigabbrev_np.o] Error 1
The reason is that SIGPWR and SIGINFO have the same value on this platform.
This patch fixes it, in the same way as glibc does.
2021-08-28 Bruno Haible <bruno@clisp.org>
sigabbrev_np, sigdescr_np: Fix compilation error on Linux/alpha.
* lib/sigabbrev_np.c (sigabbrev_np): When SIGINFO and SIGPWR have the
same value, give precendence to SIGPWR.
* lib/sigdescr_np.c (sigdescr_np): Likewise.
* tests/test-sigabbrev_np.c (main): Likewise.
* tests/test-sigdescr_np.c (main): Likewise.
diff --git a/lib/sigabbrev_np.c b/lib/sigabbrev_np.c
index 5271a16b0..51e2c3532 100644
--- a/lib/sigabbrev_np.c
+++ b/lib/sigabbrev_np.c
@@ -131,7 +131,7 @@ sigabbrev_np (int sig)
case SIGEMT: return "EMT";
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
- #if defined SIGINFO
+ #if defined SIGINFO && SIGINFO != SIGPWR
case SIGINFO: return "INFO";
#endif
/* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin */
diff --git a/lib/sigdescr_np.c b/lib/sigdescr_np.c
index 7f8dccf81..bf6abe55c 100644
--- a/lib/sigdescr_np.c
+++ b/lib/sigdescr_np.c
@@ -189,7 +189,7 @@ sigdescr_np (int sig)
return "Instruction emulation needed";
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
- #if defined SIGINFO
+ #if defined SIGINFO && SIGINFO != SIGPWR
case SIGINFO:
return "Information request";
#endif
diff --git a/tests/test-sigabbrev_np.c b/tests/test-sigabbrev_np.c
index 1138195f9..42947f8dc 100644
--- a/tests/test-sigabbrev_np.c
+++ b/tests/test-sigabbrev_np.c
@@ -129,7 +129,7 @@ main (void)
ASSERT (strcmp (sigabbrev_np (SIGEMT), "EMT") == 0);
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
- #ifdef SIGINFO
+ #ifdef SIGINFO && SIGINFO != SIGPWR
ASSERT (strcmp (sigabbrev_np (SIGINFO), "INFO") == 0);
#endif
/* AIX */
diff --git a/tests/test-sigdescr_np.c b/tests/test-sigdescr_np.c
index a3f7f85ce..5025ac16f 100644
--- a/tests/test-sigdescr_np.c
+++ b/tests/test-sigdescr_np.c
@@ -131,7 +131,7 @@ main (void)
ASSERT (strcmp (sigdescr_np (SIGEMT), "Instruction emulation needed") == 0);
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
- #ifdef SIGINFO
+ #ifdef SIGINFO && SIGINFO != SIGPWR
ASSERT (strcmp (sigdescr_np (SIGINFO), "Information request") == 0);
#endif
/* AIX */
reply other threads:[~2021-08-28 17:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3277819.HovnAMPojK@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).