Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: trigraphs, yecch |
| Date | 2012-01-31 21:25 -0800 |
| Organization | None to speak of |
| Message-ID | <ln7h07w2f5.fsf@nuthaus.mib.org> (permalink) |
| References | (2 earlier) <0.a671176e64755b2722e5.20120131164745GMT.87vcnrq0ni.fsf@bsb.me.uk> <4f2821ac.654354243@text.giganews.com> <pj9gi79muj8eac7s030orq8uictgt44beg@4ax.com> <ln8vknxxs9.fsf@nuthaus.mib.org> <jga3da$nlc$1@dont-email.me> |
"BartC" <bc@freeuk.com> writes:
> "Keith Thompson" <kst-u@mib.org> wrote in message
> news:ln8vknxxs9.fsf@nuthaus.mib.org...
>> Robert Wessel <robertwessel2@yahoo.com> writes:
>> [...]
>>> Yes. C merges adjacent strings.
>> [...]
>>
>> C merges adjacent string *literals*.
>>
>> For example, this:
>>
>> printf("hello" " world\n");
>>
>> works, but this:
>>
>> const char s[] = "hello";
>> printf(s " world\n");
>>
>> is a syntax error.
>
> On the other hand, this works as expected:
>
> #define s "hello"
>
> printf(s " world\n");
>
> Is s a string literal here?
It is by the time adjacent string literals are merged.
Macro invocations are expanded in translation phase 4. Adjacent string
literals are merged in translation phase 6.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-01-31 15:55 +0000
Re: trigraphs, yecch pete <pfiland@mindspring.com> - 2012-01-31 11:05 -0500
Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-31 16:47 +0000
Re: trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-01-31 17:21 +0000
Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 12:26 -0500
Re: trigraphs, yecch Robert Wessel <robertwessel2@yahoo.com> - 2012-01-31 11:40 -0600
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 15:22 -0800
Re: trigraphs, yecch "BartC" <bc@freeuk.com> - 2012-02-01 01:09 +0000
Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 22:21 -0500
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 21:25 -0800
Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:40 -0600
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 22:19 -0800
Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-02-01 08:27 -0500
Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-31 17:47 +0000
Re: trigraphs, yecch ImpalerCore <jadill33@gmail.com> - 2012-01-31 09:41 -0800
Re: trigraphs, yecch pete <pfiland@mindspring.com> - 2012-01-31 13:17 -0500
Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-01-31 09:56 -0800
Re: trigraphs, yecch Peter Nilsson <airia@acay.com.au> - 2012-01-31 13:55 -0800
Re: trigraphs, yecch Harald van Dijk <haraldvdijk@gmail.com> - 2012-01-31 14:02 -0800
Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-01-31 14:06 -0800
Re: trigraphs, yecch Harald van Dijk <haraldvdijk@gmail.com> - 2012-01-31 15:13 -0800
Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:44 -0600
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 22:20 -0800
Re: trigraphs, yecch James Harris <james.harris.1@googlemail.com> - 2012-01-31 22:56 -0800
Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-01 12:15 +0000
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 15:27 -0800
Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-01-31 17:01 -0800
Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 19:50 -0800
Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 10:31 -0800
Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 23:17 -0500
Re: trigraphs, yecch "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2012-02-01 10:39 +0100
Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 17:20 +0000
Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 11:11 -0800
Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:50 -0600
Re: trigraphs, yecch ralph <nt_consulting64@yahoo.net> - 2012-02-01 11:56 -0600
Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 11:12 -0800
Re: trigraphs, yecch Stephen Sprunk <stephen@sprunk.org> - 2012-02-01 13:29 -0600
Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-02-01 11:35 -0800
Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 19:59 +0000
Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-02-01 12:41 -0800
Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 22:55 +0000
Re: trigraphs, yecch Stephen Sprunk <stephen@sprunk.org> - 2012-02-01 14:44 -0600
Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 22:55 +0000
Re: trigraphs, yecch "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-02-02 14:19 -0800
Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-06 20:40 -0800
Re: trigraphs, yecch "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2012-02-07 11:40 +0100
Re: trigraphs, yecch jgk@panix.com (Joe keane) - 2012-02-02 14:15 +0000
Re: trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-02-01 16:52 +0000
csiph-web