cpp again
Prathamesh Kulkarni
bilbotheelffriend@gmail.com
Sat Mar 1 19:27:00 GMT 2014
On Sat, Mar 1, 2014 at 9:04 PM, phi gcc <phi.gcc@gmail.com> wrote:
> Hi All,
>
> I narrowed down a problem that break my builds...
>
> C4N1$ cat c.c
> #define L "cd"
> s="ab" L "ef";
> s="ab"L "ef";
> s="ab" L"ef";
> s="ab"L"ef";
String prefixed with L is a wide string literal, in your last two
examples it's L"ef"
see n1570 section 6.4.5 3rd point:
A character string literal is a sequence of zero or more multibyte
characters enclosed in
double-quotes, as in "xyz". A UTF -8 string literal is the same,
except prefixed by u8.
A wide string literal is the same, except prefixed by the letter L, u, or U.
>
> C4N1$ cc -E c.c
> # 1 "c.c"
> # 1 "<command-line>"
> # 1 "/usr/include/stdc-predef.h" 1 3 4
> # 1 "<command-line>" 2
> # 1 "c.c"
>
> s="ab" "cd" "ef";
> s="ab""cd" "ef";
> s="ab" L"ef";
> s="ab"L"ef";
>
> C4N1$
>
> Why the last 2 L are not expansed ? other compilers (non linux) do
> expand all of them.
>
> Thanx on advance
> Cheers,
> Phi
More information about the Gcc-help
mailing list