Article View: comp.std.c
Article #2791Re: stringizing
From: Norman Diamond
Date: Tue, 23 Apr 1991 07:55
Date: Tue, 23 Apr 1991 07:55
22 lines
1518 bytes
1518 bytes
In article <14888@darkstar.ucsc.edu> daniel@terra.ucsc.edu (Daniel Edelson) writes:
> #define str(x) #x
> printf("%s\n", str( hello\t\n\vworld\n\n));
>Is the output from this program supposed to be:
> hello world
Section 2.1.1.2, page 6 lines 35-36 in the Dec. 1988 draft:
Whether each nonempty sequence of white-space characters other than newline
is retained or replaced by one space character is implementation-defined.
[This is before preprocessing.]
Therefore, the output can be either (with two leading spaces):
hello\t\n\vworld\n\n\n
or (with one leading space and two imbedded spaces):
hello \n world\n\n\n
(including, in each case, the last \n from the printf format string).
However, it cannot be (regardless of the number of leading spaces) just:
hello world\n
--
Norman Diamond diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID:
<1991Apr23.075527.19443@tkou02.enet.dec.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!deccrl!news.crl.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamondReferences:
<14888@darkstar.ucsc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!deccrl!news.crl.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond From: diamond@jit345.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.std.c Subject: Re: stringizing Message-ID: <1991Apr23.075527.19443@tkou02.enet.dec.com> Date: 23 Apr 91 07:55:27 GMT References: <14888@darkstar.ucsc.edu> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 22