Commit 255508dd by Per Bothner Committed by Per Bothner

diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION and we have a…

diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION and we have a non-zero column-number, add it to the message.


	* 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.

From-SVN: r95746
parent 17c1e037
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> 2005-03-01 Zdenek Dvorak <dvorakz@suse.cz>
* cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find, * cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find,
......
...@@ -133,15 +133,18 @@ diagnostic_build_prefix (diagnostic_info *diagnostic) ...@@ -133,15 +133,18 @@ diagnostic_build_prefix (diagnostic_info *diagnostic)
#undef DEFINE_DIAGNOSTIC_KIND #undef DEFINE_DIAGNOSTIC_KIND
"must-not-happen" "must-not-happen"
}; };
const char *text = _(diagnostic_kind_text[diagnostic->kind]);
expanded_location s = expand_location (diagnostic->location); expanded_location s = expand_location (diagnostic->location);
gcc_assert (diagnostic->kind < DK_LAST_DIAGNOSTIC_KIND); gcc_assert (diagnostic->kind < DK_LAST_DIAGNOSTIC_KIND);
return s.file return
? build_message_string ("%s:%d: %s", (s.file == NULL
s.file, s.line, ? build_message_string ("%s: %s", progname, text)
_(diagnostic_kind_text[diagnostic->kind])) #ifdef USE_MAPPED_LOCATION
: build_message_string ("%s: %s", progname, : s.column != 0
_(diagnostic_kind_text[diagnostic->kind])); ? 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. */ /* Count a diagnostic. Return true if the message should be printed. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment