From 6a59f3db1a58ae83341d2fcb1d16dd216cf29f83 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 19 Apr 1996 14:02:03 +0000 Subject: [PATCH] Added `const' to types of sys_errlist and sys_nerr. Use .Va instead of .Fa to describe these variables. Say a little about inconsistent declarations of sys_errlist in the BUGS section. --- lib/libc/string/strerror.3 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3 index 784c06168ad..ebf18fda179 100644 --- a/lib/libc/string/strerror.3 +++ b/lib/libc/string/strerror.3 @@ -48,8 +48,8 @@ .Fd #include .Ft void .Fn perror "const char *string" -.Vt extern char *sys_errlist[]; -.Vt extern int sys_nerr; +.Vt extern const char * const sys_errlist[]; +.Vt extern const int sys_nerr; .Fd #include .Ft char * .Fn strerror "int errnum" @@ -100,11 +100,11 @@ followed by the error number in decimal. .Pp The message strings can be accessed directly using the external array -.Fa sys_errlist . +.Va sys_errlist . The external value -.Fa sys_nerr +.Va sys_nerr contains a count of the messages in -.Fa sys_errlist . +.Va sys_errlist . The use of these variables is deprecated; .Fn strerror should be used instead. @@ -122,3 +122,8 @@ For unknown error numbers, the .Fn strerror function will return its result in a static buffer which may be overwritten by subsequent calls. +.Pp +Programs that use the deprecated +.Va sys_errlist +variable often fail to compile because they declare it +inconsistently.