>Date: Wed, 16 Jan 2008 23:47:19 -0500
>From: Glenn Fowler <gsf at research.att.com>
>
>Don
>can you clarify
>for decimal_point and thousands_sep does the standard specify
>(1) a \0 terminated string?
>(2) if the value is "\0" then there is no corresponding separator?
>(3) if the value is "<byte1><byte2>\0" then the separator is <byte1>?
>thanks

Glenn,
This is not an official interpretation of the C99 standard... ;-}
But, the way I read C99, char *decimal_point and char *thousands_sep
each point to a single byte character; not to a string having one
single-byte character followed by a null byte.

I believe that the wording in the POSIX standard is intended to allow
the desired processing of these two pointers IF a technical corrigenda
modifies C99 to make them pointers to strings.  It may well be that
some implementations provide null terminated strings now, but the C99
standard doesn't require that and the POSIX standard doesn't require
that; so an application that assumes those pointers point to null
terminated strings is not portable.

 - Don


Reply via email to