This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libc/include/sys/errno.h


On Thu, Apr 24, 2003 at 01:20:30AM +0900, Kazuhiro Fujieda wrote:
>>>> On Wed, 23 Apr 2003 12:02:20 -0400
>>>> "J. Johnston" <jjohnstn at redhat dot com> said:
>
>> 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.
>
>The reason isn't only historical, but also compliant to the
>standard. If it is declared const, the following code described
>as the typical way of using errno in "C A Reference Manual"
>can't work anymore.
>
>    errno = 0;
>    x = sqrt(y);
>    if (errno) {
>        printf("?sqrt failed, code %d\n", errno);
>	x = 0;
>    }

That's not an issue.  errno isn't affected by this patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]