aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2010-02-26 22:06:56 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2010-02-26 22:06:56 +0000
commit0e94b75085af60341759c30fb522c9438c4b18b8 (patch)
treedc7e9199bbd5f92c7eed38be3754a171070f0408 /gcc
parent7e1542b921b63aea61cc239be5eeeb632631a5b9 (diff)
downloadgcc-0e94b75085af60341759c30fb522c9438c4b18b8.zip
gcc-0e94b75085af60341759c30fb522c9438c4b18b8.tar.gz
gcc-0e94b75085af60341759c30fb522c9438c4b18b8.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/diagnostic.c7
-rw-r--r--gcc/diagnostic.h9
-rw-r--r--gcc/toplev.c4
4 files changed, 26 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07fae6a..f731855 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
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
* doc/cpp.texi: Use c90 instead of c89 and gnu90 instead of gnu89.
* doc/standards.texi: Likewise.
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 28217a7..4322d65 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -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)
{
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 0cfadb6..e2dc8c8 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -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
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 402ad82..385d5e1 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -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,