[PATCH] Add missing strerror() strings, clean up
Craig Howland
howland@LGSInnovations.com
Fri Jul 11 01:14:00 GMT 2014
On 07/10/2014 08:12 PM, Nick Withers wrote:
> Hi Craig,
>
> Thanks for taking the time!
>
> Could you include me on any replies? I'm not subscribed.
>
>> On 07/10/2014 06:26 AM, Nick Withers wrote:
>>> Hi all,
>>>
>>> The attached patch:
>>> - Adds to strerror()'s strerror.c strings for:
>>> ...
>>>
>>> - Changes the following comments in errno.h to match the implementation:
>>> ...
>>> - EDOM, from "Math arg out of domain of func" to "Math
>>> argument" (would "Mathematics argument out of domain of function" or
>>> "Mathematical (...)" be better?)
>> "Math argument" would be a step backwards. If it were to be changed at
>> all, use the POSIX "Mathematics argument out of domain of
>> function." (The existing is POSIX with 3 abbreviations, and really
>> could be left as-is.)
> "Math argument" is the existing message. There's a comment in errno.h
> though, that is meant to match the message proper, and currently does
> not. That's what's addressed here.
>
> However, if you'd like me to change it to "Mathematics argument out of
> domain of function", happy to do so (I certainly like that better...).
Yes, I misunderstood the comment, getting it backwards as you point out. What I
should have said: EDOM seems to be a better candidate for changing the
implementation to match the errno.h comment. In the spirit of keeping size
down, using the slightly-abbreviated existing "Math arg out of domain of func"
from the errno.h comment seems to be a readily-understood good candidate for
strerror.c. If there were a strong objection to this size growth of 16 bytes,
perhaps "Math arg domain" (+2) or "Math domain" (-2) could be used, both being
more precise and more easily associated with the EDOM name. Since my
applications are not usually very tight for space, my personal preference would
be for the longer string that essentially matches POSIX.
Craig
More information about the Newlib
mailing list