decimal_point and thousands_sep issuesAuthors: Jay Ghiron
Date: 2026-09-10
Submitted against: C23
Status: Open
Cross-references: 0066, 1108
In the response to DR 66 it was mentioned that
decimal_point and thousands_sep must both be at most 1 byte, and
for decimal_point it must not be empty. There is also the general
requirement that these strings begin and end in the initial shift
sequence. However, there seems to be some requirements that ought to
be in place but are not. Consider the following printf invocation:
printf("%.1f\n",0.);
This prints the character 0, the current decimal_point, and then
the character 0. Was it intended that this may print "000",
"010", "0a0", "0z0", "0 0", or possibly even two lines "0"
and "0" because the current decimal_point is "\n"? That is,
should there be any constraints on decimal_point and thousands_sep
to prevent them from being something other than punctuation
characters? It should also be considered if redundant shift sequences
that preserve the initial shift state can be used in decimal_point
and thousands_sep, and whether or not that counts as pointing to
"". If punctuation characters are required, note that ispunct
does not imply that iswpunct will be true for the same character.