Commit b9ff4814 by Kaveh R. Ghazi Committed by Kaveh Ghazi

diagnostic.c (build_message_string, [...]): Add ATTRIBUTE_PRINTF_*.

        * diagnostic.c (build_message_string, output_printf,
        line_wrapper_printf): Add ATTRIBUTE_PRINTF_*.
        (build_location_prefix): Fix non-literal format string.

From-SVN: r31669
parent 7267d692
2000-01-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* diagnostic.c (build_message_string, output_printf,
line_wrapper_printf): Add ATTRIBUTE_PRINTF_*.
(build_location_prefix): Fix non-literal format string.
2000-01-27 Richard Henderson <rth@cygnus.com> 2000-01-27 Richard Henderson <rth@cygnus.com>
* alpha.md (trunctfsf2): New. * alpha.md (trunctfsf2): New.
......
...@@ -63,12 +63,15 @@ static void output_append PARAMS ((struct output_buffer *, const char *, ...@@ -63,12 +63,15 @@ static void output_append PARAMS ((struct output_buffer *, const char *,
static void output_puts PARAMS ((struct output_buffer *, const char *)); static void output_puts PARAMS ((struct output_buffer *, const char *));
static void dump_output PARAMS ((struct output_buffer *, FILE *)); static void dump_output PARAMS ((struct output_buffer *, FILE *));
static const char *vbuild_message_string PARAMS ((const char *, va_list)); static const char *vbuild_message_string PARAMS ((const char *, va_list));
static const char *build_message_string PARAMS ((const char *, ...)); static const char *build_message_string PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
static const char *build_location_prefix PARAMS ((const char *, int, int)); static const char *build_location_prefix PARAMS ((const char *, int, int));
static void voutput_notice PARAMS ((struct output_buffer *, const char *, static void voutput_notice PARAMS ((struct output_buffer *, const char *,
va_list)); va_list));
static void output_printf PARAMS ((struct output_buffer *, const char *, ...)); static void output_printf PARAMS ((struct output_buffer *, const char *, ...))
static void line_wrapper_printf PARAMS ((FILE *, const char *, ...)); ATTRIBUTE_PRINTF_2;
static void line_wrapper_printf PARAMS ((FILE *, const char *, ...))
ATTRIBUTE_PRINTF_2;
static void vline_wrapper_message_with_location PARAMS ((const char *, int, static void vline_wrapper_message_with_location PARAMS ((const char *, int,
int, const char *, int, const char *,
va_list)); va_list));
...@@ -315,13 +318,20 @@ build_location_prefix (file, line, warn) ...@@ -315,13 +318,20 @@ build_location_prefix (file, line, warn)
int line; int line;
int warn; int warn;
{ {
const char *fmt = file if (file)
? (warn ? "%s:%d: warning: " : "%s:%d: ") {
: (warn ? "%s: warning: " : "%s: "); if (warn)
return build_message_string ("%s:%d: warning: ", file, line);
return file else
? build_message_string (fmt, file, line) return build_message_string ("%s:%d: ", file, line);
: build_message_string (fmt, progname); }
else
{
if (warn)
return build_message_string ("%s: warning: ", progname);
else
return build_message_string ("%s: ", progname);
}
} }
/* Format a MESSAGE into BUFFER. Automatically wrap lines. */ /* Format a MESSAGE into BUFFER. Automatically wrap lines. */
......
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