Module Name: src
Committed By: kre
Date: Sat Nov 2 13:02:01 UTC 2024
Modified Files:
src/lib/libc/string: __strsignal.c
Log Message:
Stop attempting to return a (char*) in place of (const char *)
This removes a cast that was added in 1994, when __strsignal()
returned a char * to convert the const char * element of sys_siglist
into a type that matched.
It should have been removed when __strsignal() was changed to
return const char * in 1998. But wasn't.
This should fix an inane warning (treated as an error) from a
compile stupid enough to allow a natural char * (as in char buf[N])
to be returned as a result (which is, of course, fine), but complains
about returning (char *) applied to a (const char *).
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/string/__strsignal.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/string/__strsignal.c
diff -u src/lib/libc/string/__strsignal.c:1.25 src/lib/libc/string/__strsignal.c:1.26
--- src/lib/libc/string/__strsignal.c:1.25 Tue Mar 20 17:44:18 2012
+++ src/lib/libc/string/__strsignal.c Sat Nov 2 13:02:01 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: __strsignal.c,v 1.25 2012/03/20 17:44:18 matt Exp $ */
+/* $NetBSD: __strsignal.c,v 1.26 2024/11/02 13:02:01 kre Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -34,7 +34,7 @@
#if 0
static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91";
#else
-__RCSID("$NetBSD: __strsignal.c,v 1.25 2012/03/20 17:44:18 matt Exp $");
+__RCSID("$NetBSD: __strsignal.c,v 1.26 2024/11/02 13:02:01 kre Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -75,7 +75,7 @@ __strsignal(int num, char *buf, size_t b
(void)strlcpy(buf, catgets(catd, 2, (int)signum,
sys_siglist[signum]), buflen);
#else
- return((char *)sys_siglist[signum]);
+ return(sys_siglist[signum]);
#endif
} else if (signum >= SIGRTMIN && signum <= SIGRTMAX) {
#ifdef NLS