Article View: net.lang.c++
Article #99Re: experiences porting c++ release 1 to release 2 sun-2
From: Chris Crampton
Date: Fri, 14 Mar 1986 10:31
Date: Fri, 14 Mar 1986 10:31
46 lines
2116 bytes
2116 bytes
In article <224@ubu.warwick.UUCP> jeff@warwick.UUCP (Jeff Smith) writes:
>...
>
>The following patch to lex.c fixes a bug to do with cfront's
>action on preprocessor lines (discovered when I forgot to run
>cpp first). Without the fix, cfront will faithfully transcribe
>lines beginning with # for the preprocessor, except for the second
>character, which will be turned into an 'i'.
>
>*** /usr/src/cmd/c++/src/lex.c Mon Nov 25 15:53:43 1985
>--- lex.c Thu Mar 6 15:49:48 1986
>***************
>*** 1001,1006
> break;
> default: /* pass #rubbish through */
> pch('#');
> pch('i');
> while (get(c) != '\n') pch(c);
> pch('\0');
>
>--- 1001,1009 -----
> break;
> default: /* pass #rubbish through */
> pch('#');
>+ #ifdef PCHFIX
>+ pch(c);
>+ #else !PCHFIX
> pch('i');
> #endif PCHFIX
> while (get(c) != '\n') pch(c);
To get the intended effect for "#..." preprocessor lines, then a:
start_txt();
is needed just before the ``pch('#');'' in the above fix for lex.c.
The result of not putting this is that for every consecutive preprocessor
line, a preprocessor line is output; only its the wrong one. In fact the
first one is output repeatedly!
--
=======================================================================
Chris M Crampton UK JANET: cmc@uk.ac.rl.vd
Rutherford Appleton Labs, ARPA: cmc%rl.vd@ucl-cs.arpa
Didcot, OXON, U.K. UUCP: ..!mcvax!ukc!rlvd!cmc
+44 235 21900 ext. 6756
Technical Details
Message-ID:
<1170@rlvd.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!warwick!rlvd!cmcReferences:
<224@ubu.warwick.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!warwick!rlvd!cmc From: cmc@rlvd.UUCP (Chris Crampton) Newsgroups: net.lang.c++ Subject: Re: experiences porting c++ release 1 to release 2 sun-2 Message-ID: <1170@rlvd.UUCP> Date: Fri, 14-Mar-86 05:31:22 EST Article-I.D.: rlvd.1170 Posted: Fri Mar 14 05:31:22 1986 Date-Received: Mon, 17-Mar-86 03:41:00 EST References: <224@ubu.warwick.UUCP> Reply-To: cmc@rlvd.UUCP (Chris Crampton) Organization: Rutherford Appleton Laboratory, Informatics Division, U.K. Lines: 46