Commit 4b1d52c7 by Gabriel Dos Reis Committed by Gabriel Dos Reis

* diagnostic.c (diagnostic_build_prefix): Tidy.

From-SVN: r54337
parent 255d3c70
2002-06-07 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (diagnostic_build_prefix): Tidy.
2002-06-07 Neil Booth <neil@daikokuya.demon.co.uk> 2002-06-07 Neil Booth <neil@daikokuya.demon.co.uk>
* cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN, * cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN,
......
...@@ -790,24 +790,22 @@ char * ...@@ -790,24 +790,22 @@ char *
diagnostic_build_prefix (diagnostic) diagnostic_build_prefix (diagnostic)
diagnostic_info *diagnostic; diagnostic_info *diagnostic;
{ {
if (diagnostic->location.file) static const char *diagnostic_kind_text[] = {
{ #define DEFINE_DIAGNOSTIC_KIND(K, T) _(T),
if (diagnostic->kind == DK_WARNING) #include "diagnostic.def"
return build_message_string (_("%s:%d: warning: "), #undef DEFINE_DIAGNOSTIC_KIND
diagnostic->location.file, "must-not-happen"
diagnostic->location.line); };
else if (diagnostic->kind >= DK_LAST_DIAGNOSTIC_KIND)
return build_message_string ("%s:%d: ", abort();
diagnostic->location.file,
diagnostic->location.line); return diagnostic->location.file
} ? build_message_string ("%s:%d: %s",
else diagnostic->location.file,
{ diagnostic->location.line,
if (diagnostic->kind == DK_WARNING) diagnostic_kind_text[diagnostic->kind])
return build_message_string (_("%s: warning: "), progname); : build_message_string ("%s: %s", progname,
else diagnostic_kind_text[diagnostic->kind]);
return build_message_string ("%s: ", progname);
}
} }
/* Report a diagnostic MESSAGE at the declaration DECL. /* Report a diagnostic MESSAGE at the declaration DECL.
......
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