BTW, another minor problem with this patch: various buildfarm members
are whining that
prairiedog | 2019-02-17 14:25:15 | ryu_common.h:111: warning: array subscript has type 'char'
This evidently is from the next-to-last line in
static inline int
copy_special_str(char *const result, const bool sign, const bool exponent, const bool mantissa)
{
if (mantissa)
{
memcpy(result, "NaN", 3);
return 3;
}
if (sign)
{
result[0] = '-';
}
if (exponent)
{
memcpy(result + sign, "Infinity", 8);
return sign + 8;
}
result[sign] = '0';
return sign + 1;
}
IMO, this is just awful coding, using a "bool" argument in
just one place as a boolean and in four other ones as an integer.
Aside from being cowboy coding, this has very serious risks of
misbehaving on platforms where "bool" isn't C99-like, so that
"sign" could potentially have values other than 0 and 1.
Please clean up that type-punning.
regards, tom lane