Gimpel Software's PC-lint and Flexelint have a rule "971: Use of 'char' without 'signed' or 'unsigned'", that forbids using the plain char
type without specifying signedness.
http://www.gimpel.com/html/pub/msg.txt
I think this is misguided. If char
is used as an integer type then it might make sense to specify signedness explicitly, but not when it is used for textual characters. Standard library functions like printf
take pointers to plain char
, and using signed
or unsigned char
is a type mismatch. One can of course cast between the types, but that can lead to just the kind of mistakes that lint is trying to prevent.
Is this lint rule against the plain char
type wrong?