+2000-04-22 Richard Henderson <rth@cygnus.com>
+
+ * diagnostic.c (init_output_buffer): Don't initialize format_args.
+ (output_clear): Likewise.
+ (output_printf): Use va_copy.
+ (vline_wrapper_message_with_location): Likewise.
+ (v_message_with_decl): Likewise.
+ (line_wrapper_printf): VA_START infor buffer.format_args directly.
+ * system.h (va_copy): Provide default implementation.
+
2000-04-22 Richard Henderson <rth@cygnus.com>
* predict.c (expected_value_to_br_prob): Don't bomb if op1 of
output_set_prefix (buffer, prefix);
buffer->cursor = NULL;
- buffer->format_args = NULL;
}
/* Reinitialize BUFFER. */
obstack_free (&buffer->obstack, obstack_base (&buffer->obstack));
buffer->line_length = 0;
buffer->cursor = NULL;
- buffer->format_args = NULL;
}
/* Finishes to construct a NULL-terminated character string representing
msgid = va_arg (ap, const char *);
#endif
- buffer->format_args = ap;
+ va_copy (buffer->format_args, ap);
output_notice (buffer, msgid);
va_end (buffer->format_args);
}
const char *msgid;
#endif
output_buffer buffer;
- va_list ap;
- VA_START (ap, msgid);
+ init_output_buffer (&buffer, NULL, output_maximum_width);
+ VA_START (buffer.format_args, msgid);
#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, FILE *);
- msgid = va_arg (ap, const char *);
+ file = va_arg (buffer.format_args, FILE *);
+ msgid = va_arg (buffer.format_args, const char *);
#endif
- init_output_buffer (&buffer, NULL, output_maximum_width);
- buffer.format_args = ap;
output_notice (&buffer, msgid);
output_flush_on (&buffer, file);
{
output_buffer buffer;
- init_output_buffer
- (&buffer, build_location_prefix (file, line, warn), output_maximum_width);
- buffer.format_args = ap;
+ init_output_buffer (&buffer, build_location_prefix (file, line, warn),
+ output_maximum_width);
+ va_copy (buffer.format_args, ap);
output_notice (&buffer, msgid);
output_flush_on (&buffer, stderr);
{
if (doing_line_wrapping ())
{
- buffer.format_args = ap;
+ va_copy (buffer.format_args, ap);
output_notice (&buffer, p);
- ap = buffer.format_args;
+ va_copy (ap, buffer.format_args);
}
else
vfprintf (stderr, p, ap);