aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.phys.columbia.edu>1998-10-29 11:54:13 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-10-29 06:54:13 -0500
commitadd7091b5b09593736c839d9ffa33d74f5d7cb61 (patch)
tree7471f4f8da9d046f66479432942077da10b066ef /gcc/c-lex.c
parent0fc1434bd0b2e9c1f3649d8b1df27e37403dda33 (diff)
downloadgcc-add7091b5b09593736c839d9ffa33d74f5d7cb61.zip
gcc-add7091b5b09593736c839d9ffa33d74f5d7cb61.tar.gz
gcc-add7091b5b09593736c839d9ffa33d74f5d7cb61.tar.bz2
[multiple changes]
1998-10-28 16:10 -0500 Zack Weinberg <zack@rabi.phys.columbia.edu> * c-lang.c: Declare extern char *yy_cur if USE_CPPLIB. (lang_init): Call check_newline always. * c-lex.c (init_parse) [USE_CPPLIB=1]: After calling cpp_start_read, set yy_cur and yy_lim to read from parse_in.token_buffer, so that we'll see the first #line directive. * cpplib.c (cpp_start_read): finclude the main input file before processing -include/-imacros. Process -imacros and -include separately, and handle -include by stacking a buffer for the file in question as if it'd been #included. * toplev.c (documented_lang_options) Recognize -H when USE_CPPLIB is on. 1998-10-28 16:09 -0500 Zack Weinberg <zack@rabi.phys.columbia.edu> * cpplib.c: Merge do_once into do_pragma. Break file handling code out of do_include. Move append_include_chain, deps_output, file_cleanup, redundant_include_p, import_hash, lookup_import, add_import, read_filename_string, read_name_map, open_include_file, finclude, safe_read to cppfiles.c. Move prototypes for deps_output, append_include_chain, finclude to cpplib.h. Move definition of struct file_name_list there also. * cppfiles.c: New file. Contains all the above functions broken out of cpplib.c; also hack_vms_include_specification from cccp.c and find_include_file, a new function broken out of do_include. * Makefile.in (cppmain): Depend on cppfiles.o. (fix-header): Likewise. (cppfiles.o): New target. * configure.in (--enable-c-cpplib): Add cppfiles.o to extra_c_objs. Add ../cppfiles.o to extra_cxx_objs. From-SVN: r23424
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 10e9121..b6d8295 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -194,12 +194,14 @@ init_parse (filename)
init_lex ();
#if USE_CPPLIB
- yy_cur = "\n";
- yy_lim = yy_cur+1;
-
parse_in.show_column = 1;
if (! cpp_start_read (&parse_in, filename))
abort ();
+
+ /* cpp_start_read always puts at least one line directive into the
+ token buffer. We must arrange to read it out here. */
+ yy_cur = parse_in.token_buffer;
+ yy_lim = CPP_PWRITTEN (&parse_in);
#endif
return filename;