[issue12561] Compiler workaround for wide string constants in Modules/getpath.c (patch)

Martin v. Löwis report at bugs.python.org
Thu Jul 14 20:29:22 CEST 2011


Martin v. Löwis <martin at v.loewis.de> added the comment:

Why is the __W macro needed?

Please don't call it WCHAR:
- it conflicts with a same-named macro on Windows
- you are applying it to strings, not characters

FWIW, the compiler doesn't conform to standard C if it rejects this code. 6.4.5p4 says

       [#4]   In  translation  phase  6,  the  multibyte  character
       sequences specified by any sequence  of  adjacent  character
       and  wide  string  literal  tokens  are  concatenated into a
       single multibyte character sequence.  If any of  the  tokens
       are  wide  string  literal  tokens,  the resulting multibyte
       character sequence is treated  as  a  wide  string  literal;
       otherwise, it is treated as a character string literal.

----------
nosy: +loewis

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12561>
_______________________________________


More information about the Python-bugs-list mailing list