/* Various declarations for language-independent diagnostics subroutines.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
This file is part of GCC.
va_list *args_ptr;
} text_info;
-/* Contants used to discreminate diagnostics. */
+/* Contants used to discriminate diagnostics. */
typedef enum
{
#define DEFINE_DIAGNOSTIC_KIND(K, M) K,
/* True if BUFFER is in line-wrapping mode. */
#define output_is_line_wrapping(BUFFER) (output_line_cutoff (BUFFER) > 0)
+#define output_formatted_scalar(BUFFER, FORMAT, INTEGER) \
+ do \
+ { \
+ sprintf ((BUFFER)->digit_buffer, FORMAT, INTEGER); \
+ output_add_string (BUFFER, (BUFFER)->digit_buffer); \
+ } \
+ while (0)
+
/* Forward declarations. */
typedef struct diagnostic_context diagnostic_context;
typedef void (*diagnostic_starter_fn) PARAMS ((diagnostic_context *,
message, usually displayed once per compiler run. */
bool warnings_are_errors_message;
+ /* True if we should raise a SIGABRT on errors. */
+ bool abort_on_error;
+
/* This function is called before any message is printed out. It is
responsible for preparing message prefix and such. For example, it
might say:
#define diagnostic_set_last_module(DC) \
(DC)->last_module = input_file_stack_tick
+/* Raise SIGABRT on any diagnostic of severity DK_ERROR or higher. */
+#define diagnostic_abort_on_error(DC) \
+ (DC)->abort_on_error = true
+
/* This diagnostic_context is used by front-ends that directly output
diagnostic messages without going through `error', `warning',
and similar functions. */
extern diagnostic_context *global_dc;
-/* The total count of a KIND of diagnostics meitted so far. */
+/* The total count of a KIND of diagnostics emitted so far. */
#define diagnostic_kind_count(DC, DK) (DC)->diagnostic_count[(int) (DK)]
/* The number of errors that have been issued so far. Ideally, these
/* Similarly, but for sorrys. */
#define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
-/* Returns non-zero if warnings should be emitted. */
+/* Returns nonzero if warnings should be emitted. */
#define diagnostic_report_warnings_p() \
(!inhibit_warnings \
&& !(in_system_header && !warn_system_headers))
#define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
-/* Dignostic related functions. */
+/* Diagnostic related functions. */
extern void diagnostic_initialize PARAMS ((diagnostic_context *));
extern void diagnostic_report_current_module PARAMS ((diagnostic_context *));
extern void diagnostic_report_current_function PARAMS ((diagnostic_context *));
extern void output_decimal PARAMS ((output_buffer *, int));
extern void output_add_string PARAMS ((output_buffer *,
const char *));
+extern void output_add_identifier PARAMS ((output_buffer *, tree));
extern const char *output_finalize_message PARAMS ((output_buffer *));
extern void output_clear_message_text PARAMS ((output_buffer *));
extern void output_printf PARAMS ((output_buffer *, const char *,
extern void verbatim PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
extern char *file_name_as_prefix PARAMS ((const char *));
+extern void inform PARAMS ((const char *, ...));
#endif /* ! GCC_DIAGNOSTIC_H */