diagnostic.c (diagnostic_initialize): Update.
2010-02-26 Manuel López-Ibáñez <manu@gcc.gnu.org> * diagnostic.c (diagnostic_initialize): Update. (diagnostic_report_diagnostic): Test inhibit_notes_p for informative notes. * diagnostic.h (diagnostic_context): New bool inhibit_notes_p. (diagnostic_inhibit_notes): New. * toplev.c (process_options): inhibit notes with -fcompare-debug. From-SVN: r157100
This commit is contained in:
parent
7e1542b921
commit
0e94b75085
4 changed files with 26 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2010-02-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
* diagnostic.c (diagnostic_initialize): Update.
|
||||
(diagnostic_report_diagnostic): Test inhibit_notes_p for
|
||||
informative notes.
|
||||
* diagnostic.h (diagnostic_context): New bool inhibit_notes_p.
|
||||
(diagnostic_inhibit_notes): New.
|
||||
* toplev.c (process_options): inhibit notes with -fcompare-debug.
|
||||
|
||||
2010-02-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
PR c/20631
|
||||
|
|
|
@ -109,6 +109,7 @@ diagnostic_initialize (diagnostic_context *context)
|
|||
context->last_module = 0;
|
||||
context->last_function = NULL;
|
||||
context->lock = 0;
|
||||
context->inhibit_notes_p = false;
|
||||
}
|
||||
|
||||
/* Initialize DIAGNOSTIC, where the message MSG has already been
|
||||
|
@ -317,11 +318,11 @@ diagnostic_report_diagnostic (diagnostic_context *context,
|
|||
&& !diagnostic_report_warnings_p (location))
|
||||
return false;
|
||||
|
||||
if (diagnostic->kind == DK_NOTE && flag_compare_debug)
|
||||
return false;
|
||||
|
||||
if (diagnostic->kind == DK_PEDWARN)
|
||||
diagnostic->kind = pedantic_warning_kind ();
|
||||
|
||||
if (diagnostic->kind == DK_NOTE && context->inhibit_notes_p)
|
||||
return false;
|
||||
|
||||
if (context->lock > 0)
|
||||
{
|
||||
|
|
|
@ -113,8 +113,17 @@ struct diagnostic_context
|
|||
const struct line_map *last_module;
|
||||
|
||||
int lock;
|
||||
|
||||
bool inhibit_notes_p;
|
||||
};
|
||||
|
||||
static inline void
|
||||
diagnostic_inhibit_notes (diagnostic_context * context)
|
||||
{
|
||||
context->inhibit_notes_p = true;
|
||||
}
|
||||
|
||||
|
||||
/* Client supplied function to announce a diagnostic. */
|
||||
#define diagnostic_starter(DC) (DC)->begin_diagnostic
|
||||
|
||||
|
|
|
@ -1810,6 +1810,10 @@ process_options (void)
|
|||
OVERRIDE_OPTIONS;
|
||||
#endif
|
||||
|
||||
/* Avoid any informative notes in the second run of -fcompare-debug. */
|
||||
if (flag_compare_debug)
|
||||
diagnostic_inhibit_notes (global_dc);
|
||||
|
||||
if (flag_section_anchors && !target_supports_section_anchors_p ())
|
||||
{
|
||||
warning (OPT_fsection_anchors,
|
||||
|
|
Loading…
Add table
Reference in a new issue