From: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
To: phi gcc <phi.gcc@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: cpp again
Date: Sat, 01 Mar 2014 19:27:00 -0000 [thread overview]
Message-ID: <CAJXstsBrNf1G+_rgzBPHxH6Tn9=icAH0JYFEBBtMBEZTS8ZvYA@mail.gmail.com> (raw)
In-Reply-To: <CADieKzvBs7QLcvokpizLfgzL6AGZi7uT+4EsZ21UyQfRzmKNqg@mail.gmail.com>
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
next prev parent reply other threads:[~2014-03-01 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-01 15:34 phi gcc
2014-03-01 19:27 ` Prathamesh Kulkarni [this message]
2014-03-01 19:45 ` phi gcc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJXstsBrNf1G+_rgzBPHxH6Tn9=icAH0JYFEBBtMBEZTS8ZvYA@mail.gmail.com' \
--to=bilbotheelffriend@gmail.com \
--cc=gcc-help@gcc.gnu.org \
--cc=phi.gcc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).