From 22234f56d2395ae470961d3eb5fdc65a7597af9a Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Wed, 18 Feb 2004 14:02:39 -0800 Subject: re PR preprocessor/14103 (ICEs on "gcc -E -imacros foo.h baz.c") * cpphash.h (struct cpp_buffer): Restore return_at_eof field. This partly reverts my 2003-10-01 change, because we're back to logically including inside the main line. * cpplex.c (_cpp_get_fresh_line): Check return_at_eof field. * cppmacro.c (cpp_scan_nooutput): Set return_at_eof of current buffer. Fixes PR preprocessor/14103. * cppfiles.c (_cpp_stack_include): When appropriate decrement line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION. (cpp_push_include): Don't need to increment pfile's line field. * line-map.h (LAST_SOURCE_LINE_LOCATION): Only decrement by 1. * c-ppoutput.c (print struct): New first_time field. (init_pp_output): Set print.first_time. (pp_file_change): Use print.first_time, rather than MAIN_FILE_P, which is set also for (say) . Clear print.first_time. * cppfiles.c (struct _cpp_file): Comment and type for pch field does not match the code, so fix both. (should_stack_file): Inline include_pch_p function. (include_pch_p): Remove pointless function. * cpphash.h (struct cpp_buffer): Remove unused search_cached field. From-SVN: r78049 --- gcc/cppmacro.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/cppmacro.c') diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index f396a9dbec4..f4e885740b4 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -1138,6 +1138,10 @@ cpp_sys_macro_p (cpp_reader *pfile) void cpp_scan_nooutput (cpp_reader *pfile) { + /* Request a CPP_EOF token at the end of this file, rather than + transparently continuing with the including file. */ + pfile->buffer->return_at_eof = true; + if (CPP_OPTION (pfile, traditional)) while (_cpp_read_logical_line_trad (pfile)) ; -- cgit v1.2.1