https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549

--- Comment #25 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
This patch would make the note controllable via #pragma GCC diagnostic in the
same way as the warning is:

=====
diff --git a/gcc/c-family/c-indentation.cc b/gcc/c-family/c-indentation.cc
index 85a3ae1b303..3b5d3b17cc9 100644
--- a/gcc/c-family/c-indentation.cc
+++ b/gcc/c-family/c-indentation.cc
@@ -310,7 +310,8 @@ should_warn_for_misleading_indentation (const
token_indent_info &guard_tinfo,
   if (!guard_exploc.column || !body_exploc.column || !next_stmt_exploc.column)
     {
       static bool issued_note = false;
-      if (!issued_note)
+      if (!issued_note
+         && warning_enabled_at (guard_loc, OPT_Wmisleading_indentation))
        {
          /* Notify the user the first time this happens.  */
          issued_note = true;

=====

I am not quite sure how to interpret Jakub's comments though (comment 14 and
comment 16)... not sure whether he was saying this change would be undesirable,
or just explaining why it doesn't seem strictly necessary.

Reply via email to