tech-toolchain archive

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

Re: ctype(3), again



You're between the proverbial rock and hard place.

All that the application is required to do is to ensure that the value they
pass to tolower() is an int that can be represented as an unsigned char (or
EOF, but that case isn't relevant here).   How they do that isn't specified,
and simply using a "char" type in which they guarantee, somehow, that
only the values 0..127 will ever appear is one way.   Casting the value to
explicitly be unsigned char is another.

On the other hand, compilers try to warn users when they see suspicious
behaviour.

Further, there's nothing wrong with the NetBSD <ctype.h> fuictions, they
work correctly when used correctly.

The usual response to this kind of thing, is that if you're satisfied the usage
that the copiler is warning about is not a problem, you just turn off the 
warning - it has done its job by warning you.

kre



Home | Main Index | Thread Index | Old Index