[comp.sys.next] cc preprocessor question

mdeale@vega.acs.calpoly.edu (Myron Deale) (03/06/90)

Hello,
   I'd bet this is a known bug, but I'm trying to compile patch v.2
and cpp is mis-behaving. Specifically,

/lib/cpp-16 testcpp.c

where testcpp.c contains:

-------------------------
#define ABC abc
#define XYZ xyz
ABC.XYZ
-------------------------

produces
-------------------------
# 1 "testcpp."


abc .xyz
-------------------------

Like, where is the space coming from?  and the on-line doc's suggest
no option of control. Note that there is no space after the #def's.
Help.


-Myron
// mdeale@cosmos.acs.calpoly.edu

eps@toaster.SFSU.EDU (Eric P. Scott) (03/06/90)

In article <25f2ebec.2553@petunia.CalPoly.EDU>
	mdeale@vega.acs.calpoly.edu (Myron Deale) writes:
>   I'd bet this is a known bug, but I'm trying to compile patch v.2
>and cpp is mis-behaving.

I'll argue that the "known bug" isn't in cpp, but in the Configure
script in your patch sources.  Newer versions of Configure (such as
distributed with rn PL 44) work properly on NeXT machines.

In any case, there's a patch executable available by anonymous
FTP from sutro.sfsu.edu in the pub subdirectory (see the README
file).  Given that you have a leased line to our campus, you're
not going to find it anywhere closer...

					-=EPS=-

mdeale@vega.acs.calpoly.edu (Myron Deale) (03/07/90)

In article <341@toaster.SFSU.EDU> eps@cs.SFSU.EDU (Eric P. Scott) writes:
>In article <25f2ebec.2553@petunia.CalPoly.EDU>
>	mdeale@vega.acs.calpoly.edu (Myron Deale) writes:
>>   I'd bet this is a known bug, but I'm trying to compile patch v.2
>>and cpp is mis-behaving.
>
>I'll argue that the "known bug" isn't in cpp, but in the Configure
>script in your patch sources.  Newer versions of Configure (such as
>distributed with rn PL 44) work properly on NeXT machines.
>
>In any case, there's a patch executable available by anonymous
>FTP from sutro.sfsu.edu in the pub subdirectory (see the README
>file).  Given that you have a leased line to our campus, you're
>not going to find it anywhere closer...
>
>					-=EPS=-


   Thank you Eric. However, I received email from Christopher Lane and
a few others (thanks! ) suggesting I use the -traditional compiler flag.
I.e. tell Configure: /lib/cpp -traditional.  Worked like a charm.

   If anyone is interested in the process: unshar, run Configure,
comment out the last group of declarations in common.h (try #ifdef 0 /
#endif pair), then make. Apply patches 1-9 using your newly created
patch (you just gotta love it :) and make again. Unshar patch11, apply
patch10, re- Configure and re- make.
   Hey, simple huh?!

   I think it works too.


-Myron
// mdeale@cosmos.acs.calpoly.edu
PS. of course the new Configure in patch11 may be like what EPS
mentioned, although it needs the "/lib/cpp -traditional" too.

jpd00964@uxa.cso.uiuc.edu (03/07/90)

/* Written  4:45 pm  Mar  5, 1990 by mdeale@vega.acs.calpoly.edu in uxa.cso.uiuc.edu:comp.sys.next */
/* ---------- "cc preprocessor question" ---------- */
>I'd bet this is a known bug, but I'm trying to compile patch v.2
>and cpp is mis-behaving. Specifically,

Actually, its not a bug, read on.

[source code deleted but two defines next to each other were inserting an
extra space]

>Like, where is the space coming from?  and the on-line doc's suggest
>no option of control. Note that there is no space after the #def's.
>Help.


The extra space is comming from ANSI C.  You are not supposed to concatenate
the tokens in ANSI, but by using the ## token, you can.  See A12.3 in you
handy K&R v.2 for more informatio

Michael Rutman
#include <std.disc>