summaryrefslogtreecommitdiffstats
path: root/gcc/cpperror.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-08 20:37:23 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-08 20:37:23 +0000
commit5b201908e5e0588cdc3b6c73203df6b940ea2756 (patch)
tree1653b79c8f978db12857348c7022fa5ac999b2f5 /gcc/cpperror.c
parent911c015011bf99d5f05070cb763d327ee6acc823 (diff)
downloadppe42-gcc-5b201908e5e0588cdc3b6c73203df6b940ea2756.tar.gz
ppe42-gcc-5b201908e5e0588cdc3b6c73203df6b940ea2756.zip
* cpplib.h (parse_underflow_t, CPP_NULL_BUFFER): Delete.
(struct cpp_buffer): Remove fname and underflow fields. (struct cpp_reader): Remove get_token field. (struct include_hash): Rename to struct ihash. Add typedef to IHASH. (struct if_stack): Remove fname field. (IF_STACK_FRAME): Rename to IF_STACK. * cpperror.c (print_containing_files): Trust that there are no macro buffers below the top file buffer. * cppfiles.c: Replace all references to 'struct include_hash' with 'IHASH'. Rename initialize_input_buffer to init_input_buffer. Don't set or reference cpp_buffer->fname, use buffer->ihash->name instead. * cpphash.c (special_symbol): Use cpp_file_buffer. Use NULL not CPP_NULL_BUFFER. * cppinit.c: Use NULL not CPP_NULL_BUFFER, IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash. * cpplib.c: Rename eval_if_expression to eval_if_expr. Remove null_underflow. Use IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash, NULL not CPP_NULL_BUFFER. Remove all references to cpp_buffer->fname (delete entirely, or use ->ihash->name instead) and IF_STACK->fname. (cpp_push_buffer): Don't set new->underflow. (do_include): Use cpp_file_buffer. * cpphash.c (collect_formal_parameters): Remove duplicate increment of argslen. Pedwarn in C99 mode if __VA_ARGS__ is used as a macro argument name. Don't append "..." to namebuf for varargs macros. After we're done scanning, go through namebuf and make it NUL separated, not comma separated. (_cpp_compare_defs): Remove register tag from variables. Expect defn->argnames to be NUL separated. (_cpp_dump_definition): Expect defn->argnames to be NUL separated and in forward order. * cpphash.h: Update documentation of argnames field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r--gcc/cpperror.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 577840b3e97..969907b537c 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -50,34 +50,31 @@ print_containing_files (pfile, ip)
return;
/* Find the other, outer source files. */
- for (ip = CPP_PREV_BUFFER (ip);
- ip != CPP_NULL_BUFFER (pfile);
- ip = CPP_PREV_BUFFER (ip))
- if (ip->fname != NULL)
- {
- long line;
- cpp_buf_line_and_col (ip, &line, NULL);
- if (first)
- {
- first = 0;
- fprintf (stderr, _("In file included from %s:%ld"),
- ip->nominal_fname, line);
- }
- else
- /* Translators note: this message is used in conjunction
- with "In file included from %s:%ld" and some other
- tricks. We want something like this:
-
- In file included from sys/select.h:123,
- from sys/types.h:234,
- from userfile.c:31:
- bits/select.h:45: <error message here>
-
- The trailing comma is at the beginning of this message,
- and the trailing colon is not translated. */
- fprintf (stderr, _(",\n from %s:%ld"),
+ for (ip = CPP_PREV_BUFFER (ip); ip != NULL; ip = CPP_PREV_BUFFER (ip))
+ {
+ long line;
+ cpp_buf_line_and_col (ip, &line, NULL);
+ if (first)
+ {
+ first = 0;
+ fprintf (stderr, _("In file included from %s:%ld"),
ip->nominal_fname, line);
- }
+ }
+ else
+ /* Translators note: this message is used in conjunction
+ with "In file included from %s:%ld" and some other
+ tricks. We want something like this:
+
+ In file included from sys/select.h:123,
+ from sys/types.h:234,
+ from userfile.c:31:
+ bits/select.h:45: <error message here>
+
+ The trailing comma is at the beginning of this message,
+ and the trailing colon is not translated. */
+ fprintf (stderr, _(",\n from %s:%ld"),
+ ip->nominal_fname, line);
+ }
if (first == 0)
fputs (":\n", stderr);
OpenPOWER on IntegriCloud