diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-25 21:20:19 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-25 21:20:19 +0000 |
commit | 8f8953434c28ca55b6974eee9c8a94a913411787 (patch) | |
tree | f128e42344fe386dab97b5430694219834c7bcd5 /gcc | |
parent | 93033aae615ca060d7cbf72acd049b7052c98974 (diff) | |
download | gcc-8f8953434c28ca55b6974eee9c8a94a913411787.tar.gz |
* diagnostic.c (output_last_position): Define.
(set_real_maximum_length): Tweek.
* diagnostic.h (output_last_position): Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/diagnostic.c | 21 | ||||
-rw-r--r-- | gcc/diagnostic.h | 1 |
3 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5f2424a0b5..0e200f9c551 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-09-25 Gabriel Dos Reis <gdr@codesourcery.com> + + * diagnostic.c (output_last_position): Define. + (set_real_maximum_length): Tweek. + * diagnostic.h (output_last_position): Declare. + 2000-09-25 Kazu Hirata <kazu@hxi.com> * config/i386/i386.c: Fix formatting. diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index afb25c1ef3b..56ed9574bb9 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -230,8 +230,12 @@ static void set_real_maximum_length (buffer) output_buffer *buffer; { - /* If we're told not to wrap lines then do the obvious thing. */ - if (! output_is_line_wrapping (buffer)) + /* If we're told not to wrap lines then do the obvious thing. In case + we'll emit prefix only once per diagnostic message, it is appropriate + not to increase unncessarily the line-length cut-off. */ + if (! output_is_line_wrapping (buffer) + || prefixing_policy (buffer) == DIAGNOSTICS_SHOW_PREFIX_ONCE + || prefixing_policy (buffer) == DIAGNOSTICS_SHOW_PREFIX_NEVER) line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer); else { @@ -271,6 +275,19 @@ output_set_prefix (buffer, prefix) output_indentation (buffer) = 0; } +/* Return a pointer to the last character emitted in the output + BUFFER area. A NULL pointer means no character available. */ +const char * +output_last_position (buffer) + const output_buffer *buffer; +{ + const char *p = NULL; + + if (obstack_base (&buffer->obstack) != obstack_next_free (&buffer->obstack)) + p = ((const char *) obstack_next_free (&buffer->obstack)) - 1; + return p; +} + /* Free BUFFER's prefix, a previously malloc'd string. */ void diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index f3ebcf86a64..8748929da11 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -176,6 +176,7 @@ void init_output_buffer PARAMS ((output_buffer *, const char *, int)); void flush_diagnostic_buffer PARAMS ((void)); void output_clear PARAMS ((output_buffer *)); const char *output_get_prefix PARAMS ((const output_buffer *)); +const char *output_last_position PARAMS ((const output_buffer *)); void output_set_prefix PARAMS ((output_buffer *, const char *)); void output_destroy_prefix PARAMS ((output_buffer *)); void output_set_maximum_length PARAMS ((output_buffer *, int)); |