Subject: Re: ctype "(int)" casting (Re: pkg_select upgrade)
To: None <tech-userlevel@NetBSD.org>
From: Joerg Sonnenberger <firstname.lastname@example.org>
Date: 03/18/2005 02:00:32
On Thu, Mar 17, 2005 at 08:51:14AM +0100, Martin S. Weber wrote:
> So it won't dtrt w/o being an unsigned. The function prototyped version
> of is* wouldn't dtrt either, but not warn about it. So either have the
> macro do the appropriate casts so it dtrt or just shut it up without
> dtrt just like a function does. Imo the current state is not very
> helpful (and given the function signature, the adept programmer will
> take the wrong steps to solve the problem (i.e. add an (int) cast)).
To quote SUS: The c argument is an int, the value of which the application
shall ensure is representable as an unsigned char or equal to the value of
the macro EOF.
Keeping in mind that EOF == -1, you have other things to worry about
with signed chars on the current NetBSD code base.