c - Does ctype.h still require unsigned char? -


traditionally, - strictly speaking - error pass signed char ctype.h predicates because defined -1 255, -128 -2 end in reading outside array bounds.

was ever fixed, or still strictly speaking have use unsigned char avoid undefined behaviour in modern versions of c?

do still strictly speaking have use unsigned char avoid undefined behavior in modern versions of c?

yes, c11 draft standard section 7.4 character handling <ctype.h> paragraph 1 says (emphasis mine):

the header declares several functions useful classifying , mapping characters.198) in cases argument int, value of shall representable unsigned char or shall equal value of macro eof. if argument has any other value, behavior undefined.

this holds draft c99 standard well, can find in same section.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -