Re: [hatari-devel] Warnings

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On Samstag, 3. Oktober 2020 13:32:17 CEST Vincent Rivière wrote:

> if (isprint((unsigned int)c)) ...

 

If char is signed, that will still sign-extend the value, so the correct usage would be if (isprint((unsigned char)c)) ... but only if c is actually a char, not an int value that could also be EOF.

 

BTW, glibc works around this by setting up the array which is indexed by "c" in a way that works for both signed and unsigned values, so it is actually 384 bytes long (128 negative, and 256 positive indices). But cygwin uses newlib, that's why you get this warnings.

 

 



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/