Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/string Delete the BUGS paragraph about the "missing...



details:   https://anonhg.NetBSD.org/src/rev/7b7fc9c092a9
branches:  trunk
changeset: 970491:7b7fc9c092a9
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Mar 25 18:50:47 2020 +0000

description:
Delete the BUGS paragraph about the "missing" const qualifier for the
result type of strerror() (and strerror_l()).   While that once should
really have been present, when strerror() was invented, there was no
"const" qualifier in C to apply, and now the way the code is writtem
(really needs to be because of NLS support) the const is no longer
really appropriate.

Applications still shouldn't attempt to modify the result however.

diffstat:

 lib/libc/string/strerror.3 |  18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diffs (32 lines):

diff -r 3b62456871f7 -r 7b7fc9c092a9 lib/libc/string/strerror.3
--- a/lib/libc/string/strerror.3        Wed Mar 25 18:45:42 2020 +0000
+++ b/lib/libc/string/strerror.3        Wed Mar 25 18:50:47 2020 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: strerror.3,v 1.20 2020/03/25 18:45:42 kre Exp $
+.\" $NetBSD: strerror.3,v 1.21 2020/03/25 18:50:47 kre Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -271,22 +271,6 @@
 .Fn strerror_l
 use the same thread local storage, a call to either will destroy
 the result from an earlier call by the same thread of either of them.
-.\"
-.\" Is this following para really true any more?   All the strerror()
-.\" family of functions return the result in a malloc'd array (or if
-.\" ! _REENTRANT a static buffer in the function) or in a buffer
-.\" provided by the caller - nothing actually returns a pointer into
-.\" sys_errlist[] any more (strerror_ss() excepted, but we ignore that).
-.\" The POSIX (and historic) functions had no "const" qualifier.
-.\" POSIX does say that callers must not (attempt to) modify the result,
-.\" but for our implementation I see no defect that can cause.
-.Pp
-The return types for
-.Fn strerror
-and
-.Fn strerror_l
-are both missing a type-qualifier; it should actually be
-.Vt const char * .
 .Pp
 Programs that use the deprecated
 .Va sys_errlist



Home | Main Index | Thread Index | Old Index