This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for @ doubling bug in cpplib


This looks OK to me.

Dave

Zack Weinberg wrote:

> This patch fixes the bug in cpplib where @ will be doubled if
> stringified.  This is gcc.dg/990407-1.c.  It was the cause of the
> mysterious doubled @'s in f/intdoc.texi.
>
> I simply changed the macro escape character to '\r', which can never
> appear in a macro definition; any occurences due to backslash newline
> will be removed when do_define reads in the macro expansion text.
> Therefore, all the code that protects literal occurences of the escape
> character can simply be removed.
>
> Tested to bootstrap on i586-pc-linux-gnu with no regressions and
> compile glibc 2.1 (which does horrible things with macros) with no
> errors.
>
> zw
>
> 1999-04-08 19:24 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
>
>         * cpphash.c (collect_expansion, macroexpand,
>         push_macro_expansion): Make the escape character in macro
>         buffers '\r', not '@'.  Remove code to protect literal
>         occurences of the escape character; '\r' cannot appear
>         in a macro buffer unless we put it there.
>         * cpplib.c (skip_comment, copy_comment, cpp_skip_hspace,
>         copy_rest_of_line, cpp_get_token, parse_string,
>         parse_assertion): '\r' might be a backslash-newline marker, or
>         it might be a macro escape marker, depending on
>         CPP_BUFFER (pfile)->has_escapes.  '@' is not a special
>         character.
>         * cpplib.h: Update commentary.
>
>                          Name: escapes.diff.gz
>    escapes.diff.gz       Type: GNU Zip Compressed Data (application/x-gzip)
>                      Encoding: x-uuencode





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]