<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] warning cleared



On Wednesday, 21 September 2005 at 22:27, David Laight wrote:
> On Tue, Sep 20, 2005 at 12:40:24AM -0500, David Champion wrote:
> >       n = atoi(++p);                        /* find pmatch index */
> > -     while (isdigit(*p))
> > +     while (isdigit((int)*p))
> 
> Use strtoul() instead of either....

Is strtoul as portable as atoi? Every time I see a nicer interface to
an old function I assume it means I can't actually use it...

> That (int) cast has actually caused 2 programs I know of to fail.
> Causing us to remove it from NetBSD's ctype.h (where is was mistakenly
> added a few years ago) and add several hundred (unsigned char) casts
> to get code to clean compile again.  Of course this doesn't find
> all the bugs, but is a start.

The patch that went in uses unsigned char, but this particular bug
seems pretty academic anyway...