validns icon indicating copy to clipboard operation
validns copied to clipboard

The arguments to isxxxx() and family must give well-defined results.

Open he32 opened this issue 7 years ago • 2 comments

In other words, it must either be EOF or a value representable by an unsigned char. Here we simply cast all the arguments to these functions to "unsigned char".

he32 avatar Dec 21 '18 20:12 he32

Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?

tobez avatar Aug 09 '23 11:08 tobez

Would not it be better to use actual unsigned chars in many, if not all, instances, instead of blindly doing the conversion for every use of isXXXX() ?

Possibly. However, EOF cannot be represented in an unsigned char, so if you need to test for EOF that needs to be done before the returned data is passed on. I've not looked at whether that would make the diff smaller or the code simpler.

he32 avatar Sep 29 '23 17:09 he32