tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc RC scripts

On Mon, Oct 19, 2009 at 10:11:27AM -0400, Steven Bellovin wrote:
> Right, but if it were a real procedure, the explicit cast isn't
> needed, because that promotion is mandatory per the C language spec.
> In other words, putting in the cast would be for clarity, not
> correctness; the *defined* behavior is the same.

The cast is a fix for warning that exists intentionally. Passing chars
without validation to the ctype macros/functions is a bug, period. The
only exception to that rule is isascii. This is not about integer
promotion rules. It is about sign extension. Before continiung on this
reoccuring problem, please create ctype(3), especially the CAVEATS


Home | Main Index | Thread Index | Old Index