Eric Blake wrote: > > +static wchar_t wstring[] = { 'a', 'b', 'c', 0 }; > > Are we guaranteed that on all platforms, 'a' promotes to L'a'? Or should > we explicitly write the latter?
It is guaranteed: ISO C 99 paragraph 7.17.(2) says: "wchar_t ... is an integer type whose range of values can represent distinct codes for all members of the largest extended character set speciļ¬ed among the supported locales; the null character shall have the code value zero and each member of the basic character set shall have a code value equal to its value when used as the lone character in an integer character constant." The "basic character set" is defined in section 5.2.1. In practice, btowc(x) == x for all x in the ASCII range (0 <= x < 128). > Should we also test that %S serves as a synonym for %ls? I'd say, it's not useful. %S is specified only in POSIX, not in ISO C99, and the direvtives are equivalent. Users can use %ls. Bruno