diff options
| author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-01 16:37:45 +0000 |
|---|---|---|
| committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-01 16:37:45 +0000 |
| commit | 5cf564176fe9bdab8cdb6a591f5d64ac1af4cd2a (patch) | |
| tree | 5e8194fd7a7177e4ab224ad8c1642799ba8a6f95 /gcc | |
| parent | c8955ce2cf61f441e75516e54399d53074c5a7ab (diff) | |
| download | ppe42-gcc-5cf564176fe9bdab8cdb6a591f5d64ac1af4cd2a.tar.gz ppe42-gcc-5cf564176fe9bdab8cdb6a591f5d64ac1af4cd2a.zip | |
* diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION
and we have a non-zero column-number, add it to the message.
Also factor out the diagnostic_kind_text.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/diagnostic.c | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 120114c173e..a28f1bf7c40 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-03-01 Per Bothner <per@bothner.com> + + * diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION + and we have a non-zero column-number, add it to the message. + Also factor out the diagnostic_kind_text. + 2005-03-01 Zdenek Dvorak <dvorakz@suse.cz> * cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find, diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index b047167bc49..39b46fc7aef 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -133,15 +133,18 @@ diagnostic_build_prefix (diagnostic_info *diagnostic) #undef DEFINE_DIAGNOSTIC_KIND "must-not-happen" }; + const char *text = _(diagnostic_kind_text[diagnostic->kind]); expanded_location s = expand_location (diagnostic->location); gcc_assert (diagnostic->kind < DK_LAST_DIAGNOSTIC_KIND); - return s.file - ? build_message_string ("%s:%d: %s", - s.file, s.line, - _(diagnostic_kind_text[diagnostic->kind])) - : build_message_string ("%s: %s", progname, - _(diagnostic_kind_text[diagnostic->kind])); + return + (s.file == NULL + ? build_message_string ("%s: %s", progname, text) +#ifdef USE_MAPPED_LOCATION + : s.column != 0 + ? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text) +#endif + : build_message_string ("%s:%d: %s", s.file, s.line, text)); } /* Count a diagnostic. Return true if the message should be printed. */ |

