This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: _cpp_read_and_prescan patch
- To: Neil Booth <NeilB at earthling dot net>
- Subject: Re: cpplib: _cpp_read_and_prescan patch
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Mon, 27 Mar 2000 21:10:39 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <E12WfA8-0003tf-00@monkey.rosenet.ne.jp>
On Sun, Mar 19, 2000 at 09:50:32PM +0900, Neil Booth wrote:
> This patch does the following:-
>
> o Redoes the method used to detect end-of-input-buffer. Previously, a
> null character was used. Now a '\\' is used. Moreover, when
> examining the 3 special cases '?', '\\' and '\r' in the switch
> statement, enough characters are guaranteed to be in the input buffer
> that checking for end-of-buffer is not necessary. This simplifies the
> logic there, and fixes a bug (see next).
>
> o The previous logic for backslash-newline did not work correctly in
> some end-of-buffer conditions. This is fixed.
>
> o Fixes a couple of "test previous character" conditions where we
> could not be sure of their existence / contents at the very start of
> the scan (op[-1] and ip[-2] resp.)
>
> o Since nulls are no longer special, as a benefit that they are
> treated like any other "normal" character. Slight modification of
> token handling will resolve the null character problem for the
> preprocessing stage.
>
> o The code is negligibly different in speed speed to the previous
> routine.
OK.
zw