This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: libc/include/sys/errno.h
- From: "J. Johnston" <jjohnstn at redhat dot com>
- To: newlib <newlib at sources dot redhat dot com>
- Cc: Cygwin Developers <cygwin-developers at cygwin dot com>
- Date: Wed, 23 Apr 2003 12:02:20 -0400
- Subject: Re: libc/include/sys/errno.h
- Organization: Red Hat Inc.
- References: <3E9FFD2B.3070001@yahoo.com> <3EA676BE.1070002@yahoo.com>
Unfortunately, the variable is not historically declared const. If you look at
glibc, djgpp, and BSD, you will see that is declared as newlib does. Therefore,
the declaration should be left as-is.
-- Jeff J.
Earnie Boyd wrote:
ping.
Adding cygwin-developers so that it can be discussed there if necessary.
Earnie
Earnie Boyd wrote:
Any reason that this change shouldn't happen?
CGF, if this is accepted I can clean up the ugly hack in
winsup/cygwin/errno.cc.
Earnie.
------------------------------------------------------------------------
2003-04-18 Earnie Boyd <earnie at users dot sf dot net>
* include/sys/errno.h (_sys_nerr): Add _CONST modifier due to the
fact
that Cygwin uses it that way.
(sys_nerr): Add const modifier.
Index: errno.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/errno.h,v
retrieving revision 1.11
diff -u -3 -p -r1.11 errno.h
--- errno.h 24 Sep 2002 14:10:12 -0000 1.11
+++ errno.h 18 Apr 2003 13:18:56 -0000
@@ -18,10 +18,10 @@ extern int *__errno _PARAMS ((void));
/* Please don't use these variables directly.
Use strerror instead. */
extern __IMPORT _CONST char * _CONST _sys_errlist[];
-extern __IMPORT int _sys_nerr;
+extern __IMPORT _CONST int _sys_nerr;
#ifdef __CYGWIN__
extern __IMPORT const char * const sys_errlist[];
-extern __IMPORT int sys_nerr;
+extern __IMPORT const int sys_nerr;
#endif
#define __errno_r(ptr) ((ptr)->_errno)