From f0c20935793936f286587ca5f6171f7524fb5778 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 17 Dec 2000 00:13:54 +0000 Subject: * c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up. * cpperror.c (print_containing_files): Get right line number. (print_location): Output column of 1 if 0. * cppfiles.c (stack_include_file): cpp_push_buffer handles the callback. * cpphash.h (_cpp_do_file_change): No longer external. * cpplib.c (do_file_change): Now local to cpplib.c. (do_line): Fake a buffer stack for preprocessed files. (cpp_push_buffer): Create a file_change callback. Handle faked buffers. (cpp_pop_buffer): Similarly. * cpplib.h: BUF_FAKE: New buffer type. * cppmain.c: Update to handle correct file renaming where a #line is the first line of the main file, and produce only the renamed file, not the original file, as output. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38319 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cpperror.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/cpperror.c') diff --git a/gcc/cpperror.c b/gcc/cpperror.c index 87ef2cbc45d..6a48a2a7c97 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -69,7 +69,7 @@ print_containing_files (ip) The trailing comma is at the beginning of this message, and the trailing colon is not translated. */ fprintf (stderr, _(",\n from %s:%u"), - ip->nominal_fname, CPP_BUF_LINE (ip) - 1); + ip->nominal_fname, CPP_BUF_LINE (ip)); } fputs (":\n", stderr); } @@ -111,6 +111,9 @@ print_location (pfile, filename, pos) col = pos->col; } + if (col == 0) + col = 1; + /* Don't repeat the include stack unnecessarily. */ if (buffer->prev && ! buffer->include_stack_listed) { -- cgit v1.2.1