diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1995-03-20 18:44:26 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1995-03-20 18:44:26 -0800 |
commit | b64e9948211ec0fb3432ac6e0d1b7d7b08395eef (patch) | |
tree | 6a2cc6244206f99114257d30aa9a543cf45cf23c /gcc | |
parent | 23f15b0c58c2efaad722345bbf3c5924a5b72b35 (diff) | |
download | gcc-b64e9948211ec0fb3432ac6e0d1b7d7b08395eef.zip gcc-b64e9948211ec0fb3432ac6e0d1b7d7b08395eef.tar.gz gcc-b64e9948211ec0fb3432ac6e0d1b7d7b08395eef.tar.bz2 |
(print_error_function): New function hook.
(default_print_error_function): New function. Default value
of print_error_function. Code moved here from report_error_function.
(report_error_function): Use print_error_function hook.
From-SVN: r9215
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/toplev.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index b206128..e40f756 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1141,21 +1141,13 @@ announce_function (decl) } } -/* Prints out, if necessary, the name of the current function - which caused an error. Called from all error and warning functions. */ +/* The default function to print out name of current function that caused + an error. */ void -report_error_function (file) +default_print_error_function (file) char *file; { - struct file_stack *p; - - if (need_error_newline) - { - fprintf (stderr, "\n"); - need_error_newline = 0; - } - if (last_error_function != current_function_decl) { char *kind = "function"; @@ -1176,6 +1168,30 @@ report_error_function (file) last_error_function = current_function_decl; } +} + +/* Called by report_error_function to print out function name. + * Default may be overridden by language front-ends. */ + +void (*print_error_function) PROTO((char*)) = default_print_error_function; + +/* Prints out, if necessary, the name of the current function + that caused an error. Called from all error and warning functions. */ + +void +report_error_function (file) + char *file; +{ + struct file_stack *p; + + if (need_error_newline) + { + fprintf (stderr, "\n"); + need_error_newline = 0; + } + + (*print_error_function) (file); + if (input_file_stack && input_file_stack->next != 0 && input_file_stack_tick != last_error_tick) { |