diff options
author | Mike Stump <mrs@wrs.com> | 1998-12-07 14:57:30 +0000 |
---|---|---|
committer | Dave Brolley <brolley@gcc.gnu.org> | 1998-12-07 09:57:30 -0500 |
commit | c25d8793cce98e6abaaf9c44be1526aaabd54e43 (patch) | |
tree | b4caf25320b0e53c6673cf24365c3f744631bb63 | |
parent | 3a5ac29d20f6f97f0df1f49b8494b64f3e034266 (diff) | |
download | gcc-c25d8793cce98e6abaaf9c44be1526aaabd54e43.zip gcc-c25d8793cce98e6abaaf9c44be1526aaabd54e43.tar.gz gcc-c25d8793cce98e6abaaf9c44be1526aaabd54e43.tar.bz2 |
cccp.c (ignore_escape_flag): Add support for \ as `natural' characters in file names in #line to be...
Mon Dec 7 17:55:06 1998 Mike Stump <mrs@wrs.com>
* cccp.c (ignore_escape_flag): Add support for \ as `natural'
characters in file names in #line to be consistent with #include
handling. We support escape prcessing in the # 1 "..." version of
the command. See also support in cp/lex.c.
(handle_directive): Likewise.
(do_line): Likewise.
From-SVN: r24156
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cccp.c | 26 |
2 files changed, 26 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 098de32..c2811fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +Mon Dec 7 17:55:06 1998 Mike Stump <mrs@wrs.com> + + * cccp.c (ignore_escape_flag): Add support for \ as `natural' + characters in file names in #line to be consistent with #include + handling. We support escape prcessing in the # 1 "..." version of + the command. See also support in cp/lex.c. + (handle_directive): Likewise. + (do_line): Likewise. + 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu> * cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM @@ -868,6 +868,10 @@ static int errors = 0; /* Error counter for exit code */ /* Name of output file, for error messages. */ static char *out_fname; +/* Nonzero to ignore \ in string constants. Use to treat #line 1 "A:\file.h + as a non-form feed. If you want it to be a form feed, you must use + # 1 "\f". */ +static int ignore_escape_flag = 1; /* Stack of conditionals currently in progress (including both successful and failing conditionals). */ @@ -3806,6 +3810,8 @@ handle_directive (ip, op) /* Record where the directive started. do_xifdef needs this. */ directive_start = bp - 1; + ignore_escape_flag = 1; + /* Skip whitespace and \-newline. */ while (1) { if (is_hor_space[*bp]) { @@ -3868,6 +3874,7 @@ handle_directive (ip, op) pedwarn ("`#' followed by integer"); after_ident = ident; kt = line_directive_table; + ignore_escape_flag = 0; goto old_linenum; } @@ -6940,15 +6947,16 @@ do_line (buf, limit, op, keyword) return 0; case '\\': - { - char *bpc = (char *) bp; - HOST_WIDE_INT c = parse_escape (&bpc, (HOST_WIDE_INT) (U_CHAR) (-1)); - bp = (U_CHAR *) bpc; - if (c < 0) - p--; - else - p[-1] = c; - } + if (! ignore_escape_flag) + { + char *bpc = (char *) bp; + HOST_WIDE_INT c = parse_escape (&bpc, (HOST_WIDE_INT) (U_CHAR) (-1)); + bp = (U_CHAR *) bpc; + if (c < 0) + p--; + else + p[-1] = c; + } break; case '\"': |