Commit 9804f5fb by Zack Weinberg

diagnostic.c (diagnostic_for_decl): Take a diagnostic_context argument.

	* diagnostic.c (diagnostic_for_decl): Take a
	diagnostic_context argument.  Restructure to be consistent
	with diagnostic_report_diagnostic.
	(diagnostic_count_diagnostic): Now static.  Take a
	diagnostic_info argument, not just a diagnostic_t.  Some code
	moved here from internal_error.  Move a case label for
	clarity.
	(diagnostic_action_after_output): New function.  Code moved
	here from internal_error and fatal_error.
	(bug_report_request): New #define so that this text appears in
	only one place.
	(diagnostic_report_diagnostic): Update to match changes to
	diagnostic_count_diagnostic.  Call diagnostic_action_after_output.
	(diagnostic_set_info): Call gettext here.

	(pedwarn): Update comment.  Don't call gettext here.
	(sorry): Use report_diagnostic.  Don't call gettext here.
	(fatal_error): Remove final fnotice and exit, but call
	real_abort to prevent warnings about noreturn function returning.
	(internal_error): Likewise.  Don't do ICE suppression here nor
	call context->internal_error.
	(warning_with_decl): Suppress for decls in system headers.
	Adjust call to diagnostic_for_decl.
	(pedwarn_with_decl): Likewise.
	(error_with_decl): Adjust call to diagnostic_for_decl.
	(error_recursion): Use bug_report_request.

	* diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
	* objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
	diagnostic_count_diagnostic.
f:
	* bad.c: Don't call diagnostic_count_diagnostic.

From-SVN: r66728
parent 5560b019
2003-05-12 Zack Weinberg <zack@codesourcery.com>
* diagnostic.c (diagnostic_for_decl): Take a
diagnostic_context argument. Restructure to be consistent
with diagnostic_report_diagnostic.
(diagnostic_count_diagnostic): Now static. Take a
diagnostic_info argument, not just a diagnostic_t. Some code
moved here from internal_error. Move a case label for
clarity.
(diagnostic_action_after_output): New function. Code moved
here from internal_error and fatal_error.
(bug_report_request): New #define so that this text appears in
only one place.
(diagnostic_report_diagnostic): Update to match changes to
diagnostic_count_diagnostic. Call diagnostic_action_after_output.
(diagnostic_set_info): Call gettext here.
(pedwarn): Update comment. Don't call gettext here.
(sorry): Use report_diagnostic. Don't call gettext here.
(fatal_error): Remove final fnotice and exit, but call
real_abort to prevent warnings about noreturn function returning.
(internal_error): Likewise. Don't do ICE suppression here nor
call context->internal_error.
(warning_with_decl): Suppress for decls in system headers.
Adjust call to diagnostic_for_decl.
(pedwarn_with_decl): Likewise.
(error_with_decl): Adjust call to diagnostic_for_decl.
(error_recursion): Use bug_report_request.
* diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
* objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
diagnostic_count_diagnostic.
2003-05-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2003-05-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON): Correct last patch. * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON): Correct last patch.
......
...@@ -54,7 +54,8 @@ static void output_indent PARAMS ((output_buffer *)); ...@@ -54,7 +54,8 @@ static void output_indent PARAMS ((output_buffer *));
static char *build_message_string PARAMS ((const char *, ...)) static char *build_message_string PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1; ATTRIBUTE_PRINTF_1;
static void format_with_decl PARAMS ((output_buffer *, text_info *, tree)); static void format_with_decl PARAMS ((output_buffer *, text_info *, tree));
static void diagnostic_for_decl PARAMS ((diagnostic_info *, tree)); static void diagnostic_for_decl PARAMS ((diagnostic_context *,
diagnostic_info *, tree));
static void set_real_maximum_length PARAMS ((output_buffer *)); static void set_real_maximum_length PARAMS ((output_buffer *));
static void output_unsigned_decimal PARAMS ((output_buffer *, unsigned int)); static void output_unsigned_decimal PARAMS ((output_buffer *, unsigned int));
...@@ -79,6 +80,10 @@ static void default_diagnostic_finalizer PARAMS ((diagnostic_context *, ...@@ -79,6 +80,10 @@ static void default_diagnostic_finalizer PARAMS ((diagnostic_context *,
static void error_recursion PARAMS ((diagnostic_context *)) ATTRIBUTE_NORETURN; static void error_recursion PARAMS ((diagnostic_context *)) ATTRIBUTE_NORETURN;
static bool text_specifies_location PARAMS ((text_info *, location_t *)); static bool text_specifies_location PARAMS ((text_info *, location_t *));
static bool diagnostic_count_diagnostic PARAMS ((diagnostic_context *,
diagnostic_info *));
static void diagnostic_action_after_output PARAMS ((diagnostic_context *,
diagnostic_info *));
static void real_abort PARAMS ((void)) ATTRIBUTE_NORETURN; static void real_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
extern int rtl_dump_and_exit; extern int rtl_dump_and_exit;
...@@ -88,6 +93,12 @@ extern int warnings_are_errors; ...@@ -88,6 +93,12 @@ extern int warnings_are_errors;
static diagnostic_context global_diagnostic_context; static diagnostic_context global_diagnostic_context;
diagnostic_context *global_dc = &global_diagnostic_context; diagnostic_context *global_dc = &global_diagnostic_context;
/* Boilerplate text used in two locations. */
#define bug_report_request \
"Please submit a full bug report,\n\
with preprocessed source if appropriate.\n\
See %s for instructions.\n"
/* Subroutine of output_set_maximum_length. Set up BUFFER's /* Subroutine of output_set_maximum_length. Set up BUFFER's
internal maximum characters per line. */ internal maximum characters per line. */
...@@ -805,7 +816,7 @@ diagnostic_set_info (diagnostic, msgid, args, file, line, kind) ...@@ -805,7 +816,7 @@ diagnostic_set_info (diagnostic, msgid, args, file, line, kind)
int line; int line;
diagnostic_t kind; diagnostic_t kind;
{ {
diagnostic->message.format_spec = msgid; diagnostic->message.format_spec = _(msgid);
diagnostic->message.args_ptr = args; diagnostic->message.args_ptr = args;
/* If the diagnostic message doesn't specify a location, /* If the diagnostic message doesn't specify a location,
use FILE and LINE. */ use FILE and LINE. */
...@@ -850,18 +861,38 @@ diagnostic_flush_buffer (context) ...@@ -850,18 +861,38 @@ diagnostic_flush_buffer (context)
} }
/* Count a diagnostic. Return true if the message should be printed. */ /* Count a diagnostic. Return true if the message should be printed. */
bool static bool
diagnostic_count_diagnostic (context, kind) diagnostic_count_diagnostic (context, diagnostic)
diagnostic_context *context; diagnostic_context *context;
diagnostic_t kind; diagnostic_info *diagnostic;
{ {
diagnostic_t kind = diagnostic->kind;
switch (kind) switch (kind)
{ {
default: default:
abort(); abort();
break; break;
case DK_FATAL: case DK_ICE: case DK_SORRY: case DK_ICE:
#ifndef ENABLE_CHECKING
/* When not checking, ICEs are converted to fatal errors when an
error has already occurred. This is counteracted by
abort_on_error. */
if ((diagnostic_kind_count (context, DK_ERROR) > 0
|| diagnostic_kind_count (context, DK_SORRY) > 0)
&& !context->abort_on_error)
{
fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
diagnostic->location.file, diagnostic->location.line);
exit (FATAL_EXIT_CODE);
}
#endif
if (context->internal_error)
(*context->internal_error) (diagnostic->message.format_spec,
diagnostic->message.args_ptr);
/* fall through */
case DK_FATAL: case DK_SORRY:
case DK_ANACHRONISM: case DK_NOTE: case DK_ANACHRONISM: case DK_NOTE:
++diagnostic_kind_count (context, kind); ++diagnostic_kind_count (context, kind);
break; break;
...@@ -869,20 +900,22 @@ diagnostic_count_diagnostic (context, kind) ...@@ -869,20 +900,22 @@ diagnostic_count_diagnostic (context, kind)
case DK_WARNING: case DK_WARNING:
if (!diagnostic_report_warnings_p ()) if (!diagnostic_report_warnings_p ())
return false; return false;
else if (!warnings_are_errors)
if (!warnings_are_errors)
{ {
++diagnostic_kind_count (context, DK_WARNING); ++diagnostic_kind_count (context, DK_WARNING);
break; break;
} }
/* else fall through. */
case DK_ERROR: if (context->warnings_are_errors_message)
if (kind == DK_WARNING && context->warnings_are_errors_message)
{ {
output_verbatim (&context->buffer, output_verbatim (&context->buffer,
"%s: warnings being treated as errors\n", progname); "%s: warnings being treated as errors\n", progname);
context->warnings_are_errors_message = false; context->warnings_are_errors_message = false;
} }
/* and fall through */
case DK_ERROR:
++diagnostic_kind_count (context, DK_ERROR); ++diagnostic_kind_count (context, DK_ERROR);
break; break;
} }
...@@ -890,6 +923,46 @@ diagnostic_count_diagnostic (context, kind) ...@@ -890,6 +923,46 @@ diagnostic_count_diagnostic (context, kind)
return true; return true;
} }
/* Take any action which is expected to happen after the diagnostic
is written out. This function does not always return. */
static void
diagnostic_action_after_output (context, diagnostic)
diagnostic_context *context;
diagnostic_info *diagnostic;
{
switch (diagnostic->kind)
{
case DK_DEBUG:
case DK_NOTE:
case DK_ANACHRONISM:
case DK_WARNING:
break;
case DK_ERROR:
case DK_SORRY:
if (context->abort_on_error)
real_abort ();
break;
case DK_ICE:
if (context->abort_on_error)
real_abort ();
fnotice (stderr, bug_report_request, bug_report_url);
exit (FATAL_EXIT_CODE);
case DK_FATAL:
if (context->abort_on_error)
real_abort ();
fnotice (stderr, "compilation terminated.\n");
exit (FATAL_EXIT_CODE);
default:
real_abort ();
}
}
/* Called when the start of a function definition is parsed, /* Called when the start of a function definition is parsed,
this function prints on stderr the name of the function. */ this function prints on stderr the name of the function. */
void void
...@@ -1016,40 +1089,40 @@ diagnostic_report_diagnostic (context, diagnostic) ...@@ -1016,40 +1089,40 @@ diagnostic_report_diagnostic (context, diagnostic)
if (context->lock++) if (context->lock++)
error_recursion (context); error_recursion (context);
if (diagnostic_count_diagnostic (context, diagnostic->kind)) if (diagnostic_count_diagnostic (context, diagnostic))
{ {
(*diagnostic_starter (context)) (context, diagnostic); (*diagnostic_starter (context)) (context, diagnostic);
output_format (&context->buffer, &diagnostic->message); output_format (&context->buffer, &diagnostic->message);
(*diagnostic_finalizer (context)) (context, diagnostic); (*diagnostic_finalizer (context)) (context, diagnostic);
output_flush (&context->buffer); output_flush (&context->buffer);
diagnostic_action_after_output (context, diagnostic);
} }
if (context->abort_on_error && diagnostic->kind <= DK_ERROR) context->lock--;
real_abort();
--context->lock;
} }
/* Report a diagnostic MESSAGE at the declaration DECL. /* Report a diagnostic MESSAGE at the declaration DECL.
MSG is a format string which uses %s to substitute the declaration MSG is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la output_format. */ name; subsequent substitutions are a la output_format. */
static void static void
diagnostic_for_decl (diagnostic, decl) diagnostic_for_decl (context, diagnostic, decl)
diagnostic_context *context;
diagnostic_info *diagnostic; diagnostic_info *diagnostic;
tree decl; tree decl;
{ {
if (global_dc->lock++) if (context->lock++)
error_recursion (global_dc); error_recursion (context);
if (diagnostic_count_diagnostic (global_dc, diagnostic->kind)) if (diagnostic_count_diagnostic (context, diagnostic))
{ {
diagnostic_report_current_function (global_dc); (*diagnostic_starter (context)) (context, diagnostic);
output_set_prefix format_with_decl (&context->buffer, &diagnostic->message, decl);
(&global_dc->buffer, diagnostic_build_prefix (diagnostic)); (*diagnostic_finalizer (context)) (context, diagnostic);
format_with_decl (&global_dc->buffer, &diagnostic->message, decl); output_flush (&context->buffer);
output_flush (&global_dc->buffer); diagnostic_action_after_output (context, diagnostic);
output_destroy_prefix (&global_dc->buffer);
} }
global_dc->lock--;
context->lock--;
} }
/* Given a partial pathname as input, return another pathname that /* Given a partial pathname as input, return another pathname that
...@@ -1148,15 +1221,14 @@ warning VPARAMS ((const char *msgid, ...)) ...@@ -1148,15 +1221,14 @@ warning VPARAMS ((const char *msgid, ...))
VA_CLOSE (ap); VA_CLOSE (ap);
} }
/* A "pedantic" warning. Use this for code which triggers a /* A "pedantic" warning: issues a warning unless -pedantic-errors was
diagnostic which is required by the relevant language given on the command line, in which case it issues an error. Use
specification, but which is considered unhelpful (i.e. there isn't this for diagnostics required by the relevant language standard,
anything *really* wrong with the construct in the language as she if you have chosen not to make them errors.
is spoke). It is a normal warning unless -pedantic-errors is
applied, which turns it into an error. Note that pedwarn-s still Note that these diagnostics are issued independent of the setting
happen if -pedantic is not given; you must write of the -pedantic command-line switch. To get a warning enabled
"if (pedantic) pedwarn (...)" to get a warning enabled only under only with that switch, write "if (pedantic) pedwarn (...);" */
-pedantic. All such warnings should, however, use pedwarn. */
void void
pedwarn VPARAMS ((const char *msgid, ...)) pedwarn VPARAMS ((const char *msgid, ...))
{ {
...@@ -1164,7 +1236,7 @@ pedwarn VPARAMS ((const char *msgid, ...)) ...@@ -1164,7 +1236,7 @@ pedwarn VPARAMS ((const char *msgid, ...))
VA_OPEN (ap, msgid); VA_OPEN (ap, msgid);
VA_FIXEDARG (ap, const char *, msgid); VA_FIXEDARG (ap, const char *, msgid);
diagnostic_set_info (&diagnostic, _(msgid), &ap, input_filename, input_line, diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, input_line,
pedantic_error_kind ()); pedantic_error_kind ());
report_diagnostic (&diagnostic); report_diagnostic (&diagnostic);
VA_CLOSE (ap); VA_CLOSE (ap);
...@@ -1197,14 +1269,9 @@ sorry VPARAMS ((const char *msgid, ...)) ...@@ -1197,14 +1269,9 @@ sorry VPARAMS ((const char *msgid, ...))
VA_OPEN (ap, msgid); VA_OPEN (ap, msgid);
VA_FIXEDARG (ap, const char *, msgid); VA_FIXEDARG (ap, const char *, msgid);
++sorrycount; diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, input_line,
diagnostic_set_info (&diagnostic, _(msgid), &ap, DK_SORRY);
input_filename, input_line, DK_SORRY); report_diagnostic (&diagnostic);
output_set_prefix
(&global_dc->buffer, diagnostic_build_prefix (&diagnostic));
output_format (&global_dc->buffer, &diagnostic.message);
output_flush (&global_dc->buffer);
VA_CLOSE (ap); VA_CLOSE (ap);
} }
...@@ -1224,8 +1291,8 @@ fatal_error VPARAMS ((const char *msgid, ...)) ...@@ -1224,8 +1291,8 @@ fatal_error VPARAMS ((const char *msgid, ...))
report_diagnostic (&diagnostic); report_diagnostic (&diagnostic);
VA_CLOSE (ap); VA_CLOSE (ap);
fnotice (stderr, "compilation terminated.\n"); /* NOTREACHED */
exit (FATAL_EXIT_CODE); real_abort ();
} }
/* An internal consistency check has failed. We make no attempt to /* An internal consistency check has failed. We make no attempt to
...@@ -1240,31 +1307,13 @@ internal_error VPARAMS ((const char *msgid, ...)) ...@@ -1240,31 +1307,13 @@ internal_error VPARAMS ((const char *msgid, ...))
VA_OPEN (ap, msgid); VA_OPEN (ap, msgid);
VA_FIXEDARG (ap, const char *, msgid); VA_FIXEDARG (ap, const char *, msgid);
if (global_dc->lock)
error_recursion (global_dc);
#ifndef ENABLE_CHECKING
if (errorcount > 0 || sorrycount > 0)
{
fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
input_filename, input_line);
exit (FATAL_EXIT_CODE);
}
#endif
if (global_dc->internal_error != 0)
(*global_dc->internal_error) (_(msgid), &ap);
diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, input_line, diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, input_line,
DK_ICE); DK_ICE);
report_diagnostic (&diagnostic); report_diagnostic (&diagnostic);
VA_CLOSE (ap); VA_CLOSE (ap);
fnotice (stderr, /* NOTREACHED */
"Please submit a full bug report,\n\ real_abort ();
with preprocessed source if appropriate.\n\
See %s for instructions.\n", bug_report_url);
exit (FATAL_EXIT_CODE);
} }
/* Variants of some of the above, which make reference to a particular /* Variants of some of the above, which make reference to a particular
...@@ -1278,10 +1327,15 @@ warning_with_decl VPARAMS ((tree decl, const char *msgid, ...)) ...@@ -1278,10 +1327,15 @@ warning_with_decl VPARAMS ((tree decl, const char *msgid, ...))
VA_FIXEDARG (ap, tree, decl); VA_FIXEDARG (ap, tree, decl);
VA_FIXEDARG (ap, const char *, msgid); VA_FIXEDARG (ap, const char *, msgid);
/* Do not issue a warning about a decl which came from a system header,
unless -Wsystem-headers. */
if (DECL_IN_SYSTEM_HEADER (decl) && !warn_system_headers)
return;
diagnostic_set_info (&diagnostic, msgid, &ap, diagnostic_set_info (&diagnostic, msgid, &ap,
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
DK_WARNING); DK_WARNING);
diagnostic_for_decl (&diagnostic, decl); diagnostic_for_decl (global_dc, &diagnostic, decl);
VA_CLOSE (ap); VA_CLOSE (ap);
} }
...@@ -1293,18 +1347,16 @@ pedwarn_with_decl VPARAMS ((tree decl, const char *msgid, ...)) ...@@ -1293,18 +1347,16 @@ pedwarn_with_decl VPARAMS ((tree decl, const char *msgid, ...))
VA_FIXEDARG (ap, tree, decl); VA_FIXEDARG (ap, tree, decl);
VA_FIXEDARG (ap, const char *, msgid); VA_FIXEDARG (ap, const char *, msgid);
diagnostic_set_info (&diagnostic, _(msgid), &ap, /* Do not issue a warning about a decl which came from a system header,
unless -Wsystem-headers. */
if (DECL_IN_SYSTEM_HEADER (decl) && !warn_system_headers)
return;
diagnostic_set_info (&diagnostic, msgid, &ap,
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
pedantic_error_kind ()); pedantic_error_kind ());
diagnostic_for_decl (global_dc, &diagnostic, decl);
/* We don't want -pedantic-errors to cause the compilation to fail from
"errors" in system header files. Sometimes fixincludes can't fix what's
broken (eg: unsigned char bitfields - fixing it may change the alignment
which will cause programs to mysteriously fail because the C library
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 (&diagnostic, decl);
VA_CLOSE (ap); VA_CLOSE (ap);
} }
...@@ -1319,7 +1371,7 @@ error_with_decl VPARAMS ((tree decl, const char *msgid, ...)) ...@@ -1319,7 +1371,7 @@ error_with_decl VPARAMS ((tree decl, const char *msgid, ...))
diagnostic_set_info (&diagnostic, msgid, &ap, diagnostic_set_info (&diagnostic, msgid, &ap,
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
DK_ERROR); DK_ERROR);
diagnostic_for_decl (&diagnostic, decl); diagnostic_for_decl (global_dc, &diagnostic, decl);
VA_CLOSE (ap); VA_CLOSE (ap);
} }
...@@ -1410,10 +1462,7 @@ error_recursion (context) ...@@ -1410,10 +1462,7 @@ error_recursion (context)
fnotice (stderr, fnotice (stderr,
"Internal compiler error: Error reporting routines re-entered.\n"); "Internal compiler error: Error reporting routines re-entered.\n");
fnotice (stderr, fnotice (stderr, bug_report_request, bug_report_url);
"Please submit a full bug report,\n\
with preprocessed source if appropriate.\n\
See %s for instructions.\n", bug_report_url);
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -294,8 +294,6 @@ extern void diagnostic_initialize PARAMS ((diagnostic_context *)); ...@@ -294,8 +294,6 @@ extern void diagnostic_initialize PARAMS ((diagnostic_context *));
extern void diagnostic_report_current_module PARAMS ((diagnostic_context *)); extern void diagnostic_report_current_module PARAMS ((diagnostic_context *));
extern void diagnostic_report_current_function PARAMS ((diagnostic_context *)); extern void diagnostic_report_current_function PARAMS ((diagnostic_context *));
extern void diagnostic_flush_buffer PARAMS ((diagnostic_context *)); extern void diagnostic_flush_buffer PARAMS ((diagnostic_context *));
extern bool diagnostic_count_diagnostic PARAMS ((diagnostic_context *,
diagnostic_t));
extern void diagnostic_report_diagnostic PARAMS ((diagnostic_context *, extern void diagnostic_report_diagnostic PARAMS ((diagnostic_context *,
diagnostic_info *)); diagnostic_info *));
extern void diagnostic_set_info PARAMS ((diagnostic_info *, extern void diagnostic_set_info PARAMS ((diagnostic_info *,
......
2003-05-12 Zack Weinberg <zack@codesourcery.com>
* bad.c: Don't call diagnostic_count_diagnostic.
2003-05-12 Roger Sayle <roger@eyesopen.com> 2003-05-12 Roger Sayle <roger@eyesopen.com>
* com.c (ffecom_init_0): Define built-in functions for atan2, * com.c (ffecom_init_0): Define built-in functions for atan2,
......
...@@ -203,11 +203,12 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev, ...@@ -203,11 +203,12 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
if ((ffebad_severity_ != FFEBAD_severityPEDANTIC) if ((ffebad_severity_ != FFEBAD_severityPEDANTIC)
|| !flag_pedantic_errors) || !flag_pedantic_errors)
{ {
if (!diagnostic_count_diagnostic (global_dc, DK_WARNING)) if (!diagnostic_report_warnings_p ())
{ /* User wants no warnings. */ { /* User wants no warnings. */
ffebad_is_temp_inhibited_ = TRUE; ffebad_is_temp_inhibited_ = TRUE;
return FALSE; return FALSE;
} }
diagnostic_kind_count (global_dc, DK_WARNING)++;
break; break;
} }
/* Fall through (PEDANTIC && flag_pedantic_errors). */ /* Fall through (PEDANTIC && flag_pedantic_errors). */
...@@ -215,7 +216,7 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev, ...@@ -215,7 +216,7 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
case FFEBAD_severityWEIRD: case FFEBAD_severityWEIRD:
case FFEBAD_severitySEVERE: case FFEBAD_severitySEVERE:
case FFEBAD_severityDISASTER: case FFEBAD_severityDISASTER:
diagnostic_count_diagnostic (global_dc, DK_ERROR); diagnostic_kind_count (global_dc, DK_ERROR)++;
break; break;
default: default:
......
...@@ -3539,10 +3539,6 @@ error_with_ivar (message, decl, rawdecl) ...@@ -3539,10 +3539,6 @@ error_with_ivar (message, decl, rawdecl)
tree decl; tree decl;
tree rawdecl; tree rawdecl;
{ {
diagnostic_count_diagnostic (global_dc, DK_ERROR);
diagnostic_report_current_function (global_dc);
error ("%H%s `%s'", &DECL_SOURCE_LOCATION (decl), error ("%H%s `%s'", &DECL_SOURCE_LOCATION (decl),
message, gen_declaration (rawdecl, errbuf)); message, gen_declaration (rawdecl, errbuf));
...@@ -7108,11 +7104,6 @@ warn_with_method (message, mtype, method) ...@@ -7108,11 +7104,6 @@ warn_with_method (message, mtype, method)
int mtype; int mtype;
tree method; tree method;
{ {
if (!diagnostic_count_diagnostic (global_dc, DK_WARNING))
return;
diagnostic_report_current_function (global_dc);
/* Add a readable method name to the warning. */ /* Add a readable method name to the warning. */
warning ("%H%s `%c%s'", &DECL_SOURCE_LOCATION (method), warning ("%H%s `%c%s'", &DECL_SOURCE_LOCATION (method),
message, mtype, gen_method_decl (method, errbuf)); message, mtype, gen_method_decl (method, errbuf));
......
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