summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-18 08:40:32 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-18 08:40:32 +0000
commitfcb2cdc1ebd7a811dc8946aed28f371144d58c24 (patch)
tree408c67b67b9b53588977593ecb6b22fdb4787f2d /gcc
parent4443958b7e14f0132f978466175b36385a64f1ff (diff)
downloadgcc-fcb2cdc1ebd7a811dc8946aed28f371144d58c24.tar.gz
2000-07-17 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.h (report_diagnostic): Change prototype. * diagnostic.c (output_do_verbatim, diagnostic_for_asm, diagnostic_for_decl): Change prototype. (error_with_decl, warning_with_decl, pedwarn_with_decl, warning, error, warning, error_with_file_and_line, warning_with_file_and_line, pedwarn_with_file_and_line, fatal): Adjust call to report_diagnostic, diagnostic_for_decl. (error_for_asm, warning_for_asm): Adjust call to diagnostic_for_asm. (output_verbatim, verbatim): Adjust call to output_do_verbatim. * c-errors.c (pedwarn_c99): Adjust call to report_diagnostic. End varaible argument list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35116 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/c-errors.c3
-rw-r--r--gcc/diagnostic.c59
-rw-r--r--gcc/diagnostic.h2
4 files changed, 49 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 16065e22b89..7260401d4d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2000-07-17 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * diagnostic.h (report_diagnostic): Change prototype.
+
+ * diagnostic.c (output_do_verbatim, diagnostic_for_asm,
+ diagnostic_for_decl): Change prototype.
+ (error_with_decl, warning_with_decl, pedwarn_with_decl, warning,
+ error, warning, error_with_file_and_line,
+ warning_with_file_and_line, pedwarn_with_file_and_line, fatal):
+ Adjust call to report_diagnostic, diagnostic_for_decl.
+ (error_for_asm, warning_for_asm): Adjust call to diagnostic_for_asm.
+ (output_verbatim, verbatim): Adjust call to output_do_verbatim.
+
+ * c-errors.c (pedwarn_c99): Adjust call to report_diagnostic. End
+ varaible argument list.
+
2000-02-17 Zack Weinberg <zack@wolery.cumb.org>
* cpphash.c: Don't include hashtab.h. Most macro-handling code
diff --git a/gcc/c-errors.c b/gcc/c-errors.c
index a553d29abe5..7c86be9211b 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -43,6 +43,7 @@ pedwarn_c99 VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, input_filename, lineno,
+ report_diagnostic (msgid, &ap, input_filename, lineno,
!flag_isoc99 || !flag_pedantic_errors);
+ va_end (ap);
}
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 4294ba5da39..5ab32664900 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA. */
/* Prototypes. */
static void finish_diagnostic PARAMS ((void));
static void output_do_verbatim PARAMS ((output_buffer *,
- const char *, va_list));
+ const char *, va_list *));
static void output_to_stream PARAMS ((output_buffer *, FILE *));
static void output_format PARAMS ((output_buffer *));
@@ -75,8 +75,8 @@ static char *context_as_prefix PARAMS ((const char *, int, int));
static void output_do_printf PARAMS ((output_buffer *, const char *));
static void format_with_decl PARAMS ((output_buffer *, tree));
static void file_and_line_for_asm PARAMS ((rtx, const char **, int *));
-static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list, int));
-static void diagnostic_for_decl PARAMS ((tree, const char *, va_list, int));
+static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *, int));
+static void diagnostic_for_decl PARAMS ((tree, const char *, va_list *, int));
static void vnotice PARAMS ((FILE *, const char *, va_list));
static void set_real_maximum_length PARAMS ((output_buffer *));
@@ -875,27 +875,27 @@ file_and_line_for_asm (insn, pfile, pline)
of the insn INSN. This is used only when INSN is an `asm' with operands,
and each ASM_OPERANDS records its own source file and line. */
static void
-diagnostic_for_asm (insn, msg, args, warn)
+diagnostic_for_asm (insn, msg, args_ptr, warn)
rtx insn;
const char *msg;
- va_list args;
+ va_list *args_ptr;
int warn;
{
const char *file;
int line;
file_and_line_for_asm (insn, &file, &line);
- report_diagnostic (msg, args, file, line, warn);
+ report_diagnostic (msg, args_ptr, file, line, warn);
}
/* Report a diagnostic MESSAGE at the declaration DECL.
MSG is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la output_format. */
static void
-diagnostic_for_decl (decl, msg, args, warn)
+diagnostic_for_decl (decl, msg, args_ptr, warn)
tree decl;
const char *msg;
- va_list args;
+ va_list *args_ptr;
int warn;
{
output_state os;
@@ -907,7 +907,7 @@ diagnostic_for_decl (decl, msg, args, warn)
output_set_prefix
(diagnostic_buffer, context_as_prefix
(DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), warn));
- output_buffer_ptr_to_format_args (diagnostic_buffer) = &args;
+ output_buffer_ptr_to_format_args (diagnostic_buffer) = args_ptr;
output_buffer_text_cursor (diagnostic_buffer) = msg;
format_with_decl (diagnostic_buffer, decl);
finish_diagnostic ();
@@ -1000,7 +1000,8 @@ pedwarn VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, input_filename, lineno, !flag_pedantic_errors);
+ report_diagnostic (msgid, &ap, input_filename, lineno,
+ !flag_pedantic_errors);
va_end (ap);
}
@@ -1027,7 +1028,7 @@ pedwarn_with_decl VPARAMS ((tree decl, const char *msgid, ...))
or kernel uses the original layout). There's no point in issuing a
warning either, it's just unnecessary noise. */
if (!DECL_IN_SYSTEM_HEADER (decl))
- diagnostic_for_decl (decl, msgid, ap, !flag_pedantic_errors);
+ diagnostic_for_decl (decl, msgid, &ap, !flag_pedantic_errors);
va_end (ap);
}
@@ -1051,7 +1052,7 @@ pedwarn_with_file_and_line VPARAMS ((const char *file, int line,
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, file, line, !flag_pedantic_errors);
+ report_diagnostic (msgid, &ap, file, line, !flag_pedantic_errors);
va_end (ap);
}
@@ -1191,7 +1192,7 @@ error_with_file_and_line VPARAMS ((const char *file, int line,
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, file, line, /* warn = */ 0);
+ report_diagnostic (msgid, &ap, file, line, /* warn = */ 0);
va_end (ap);
}
@@ -1211,7 +1212,7 @@ error_with_decl VPARAMS ((tree decl, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- diagnostic_for_decl (decl, msgid, ap, /* warn = */ 0);
+ diagnostic_for_decl (decl, msgid, &ap, /* warn = */ 0);
va_end (ap);
}
@@ -1231,7 +1232,7 @@ error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- diagnostic_for_asm (insn, msgid, ap, /* warn = */ 0);
+ diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
va_end (ap);
}
@@ -1249,7 +1250,7 @@ error VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, input_filename, lineno, /* warn = */ 0);
+ report_diagnostic (msgid, &ap, input_filename, lineno, /* warn = */ 0);
va_end (ap);
}
@@ -1285,7 +1286,7 @@ fatal VPARAMS ((const char *msgid, ...))
if (fatal_function != NULL)
(*fatal_function) (_(msgid), args_for_fatal_msg);
va_end (args_for_fatal_msg);
- report_diagnostic (msgid, ap, input_filename, lineno, 0);
+ report_diagnostic (msgid, &ap, input_filename, lineno, 0);
va_end (ap);
exit (FATAL_EXIT_CODE);
}
@@ -1336,7 +1337,7 @@ warning_with_file_and_line VPARAMS ((const char *file, int line,
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, file, line, /* warn = */ 1);
+ report_diagnostic (msgid, &ap, file, line, /* warn = */ 1);
va_end (ap);
}
@@ -1356,7 +1357,7 @@ warning_with_decl VPARAMS ((tree decl, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- diagnostic_for_decl (decl, msgid, ap, /* warn = */ 1);
+ diagnostic_for_decl (decl, msgid, &ap, /* warn = */ 1);
va_end (ap);
}
@@ -1376,7 +1377,7 @@ warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- diagnostic_for_asm (insn, msgid, ap, /* warn = */ 1);
+ diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
va_end (ap);
}
@@ -1394,7 +1395,7 @@ warning VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- report_diagnostic (msgid, ap, input_filename, lineno, /* warn = */ 1);
+ report_diagnostic (msgid, &ap, input_filename, lineno, /* warn = */ 1);
va_end (ap);
}
@@ -1411,10 +1412,10 @@ finish_diagnostic ()
/* Helper subroutine of output_verbatim and verbatim. Do the approriate
settings needed by BUFFER for a verbatim formatting. */
static void
-output_do_verbatim (buffer, msg, args)
+output_do_verbatim (buffer, msg, args_ptr)
output_buffer *buffer;
const char *msg;
- va_list args;
+ va_list *args_ptr;
{
output_state os;
@@ -1422,7 +1423,7 @@ output_do_verbatim (buffer, msg, args)
output_prefix (buffer) = NULL;
prefixing_policy (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
output_buffer_text_cursor (buffer) = msg;
- output_buffer_ptr_to_format_args (buffer) = &args;
+ output_buffer_ptr_to_format_args (buffer) = args_ptr;
output_set_maximum_length (buffer, 0);
output_format (buffer);
buffer->state = os;
@@ -1443,7 +1444,7 @@ output_verbatim VPARAMS ((output_buffer *buffer, const char *msg, ...))
buffer = va_arg (ap, output_buffer *);
msg = va_arg (ap, const char *);
#endif
- output_do_verbatim (buffer, msg, ap);
+ output_do_verbatim (buffer, msg, &ap);
va_end (ap);
}
@@ -1460,7 +1461,7 @@ verbatim VPARAMS ((const char *msg, ...))
#ifndef ANSI_PROTOTYPES
msg = va_arg (ap, const char *);
#endif
- output_do_verbatim (diagnostic_buffer, msg, ap);
+ output_do_verbatim (diagnostic_buffer, msg, &ap);
output_to_stream (diagnostic_buffer, stderr);
va_end (ap);
}
@@ -1472,9 +1473,9 @@ verbatim VPARAMS ((const char *msg, ...))
The front-end independent format specifiers are exactly those described
in the documentation of output_format. */
void
-report_diagnostic (msg, args, file, line, warn)
+report_diagnostic (msg, args_ptr, file, line, warn)
const char *msg;
- va_list args;
+ va_list *args_ptr;
const char *file;
int line;
int warn;
@@ -1485,7 +1486,7 @@ report_diagnostic (msg, args, file, line, warn)
return;
os = diagnostic_buffer->state;
diagnostic_msg = msg;
- diagnostic_args = &args;
+ diagnostic_args = args_ptr;
report_error_function (file);
output_set_prefix
(diagnostic_buffer, context_as_prefix (file, line, warn));
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index a81aa8abb80..6a392e38eb4 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -101,7 +101,7 @@ extern int diagnostic_message_length_per_line;
extern output_buffer *diagnostic_buffer;
/* Prototypes */
-void report_diagnostic PARAMS ((const char *, va_list,
+void report_diagnostic PARAMS ((const char *, va_list *,
const char *, int, int));
void initialize_diagnostics PARAMS ((void));
void reshape_diagnostic_buffer PARAMS ((void));