[tex-k] Wrong constant value?

Douglas McKenna doug at mathemaesthetics.com
Tue Dec 5 02:26:35 CET 2017


In the kpathsea header file "c-minmax.h" the line

   #define SCHAR_MAX 128

seems to me to be incorrect.  I would think it should be

   #define SCHAR_MAX 127

assuming it's supposed to be defined in a manner similar to the other integer limits in that file for shorts or ints, which is to say the highest signed legal integer value given the number of bits (8 bits = 127, 16 bits = 32767, 32 bits = 2147483647, 64 bits = 9223372036854775807).

It has never mattered in kpathsea, I suppose, because no other kpathsea source files appear to use the constant that I can tell.

But I mention this on the list because some other code that includes this header file might rely on it.  Which might be bad or lead to unexpected results.


Doug McKenna




More information about the tex-k mailing list