Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!network.ucsd.edu!weber!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.lang.c Subject: Re: "proper" output from cpp? Message-ID: <2938@network.ucsd.edu> Date: 17 Sep 90 01:52:13 GMT References: <2936@network.ucsd.edu> Sender: news@network.ucsd.edu Reply-To: pbiron@weber.ucsd.edu (Paul Biron) Organization: Division of Social Sciences, UCSD Lines: 30 Nntp-Posting-Host: weber.ucsd.edu In article <2936@network.ucsd.edu> pbiron@weber.ucsd.edu (Paul Biron) writes: >Can someone tell me whether this is "proper" output from cpp: > > % cat << EOF | /lib/cpp > #define ABC abc > #define XYZ xyz > ABC.XYZ > EOF > > # 1 "" > > > abc .xyz > >Note the extra space AFTER abc and before the '.' I have been informed that the ANSI standard specifies that a space SHOULD be placed around macro expansions. And since gcc (and cc on the NeXT) are ANSI compliant that this is "proper" output. I also tried this using the -Aa ANSI switch in cc for HP-UX 7.0 and it inserts the space as well. The other systems I mentioned in my original posting (SunOS 4.0 and 4.3 BSD on a Vax were NOT ANSI compliant); and hence my confusion. Thanx, Paul Biron pbiron@ucsd.edu (619) 534-5758 Central University Library, Mail Code C-075-R Social Sciences DataBase Project University of California, San Diego, La Jolla, Ca. 92093