From f6069ccc2b4a6d02ae3f51119a6471a3b11b2119 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 10 Dec 2015 18:21:00 +0000 Subject: [PATCH] Add -Wmisleading-indentation to -Wall gcc/c-family/ChangeLog: * c.opt (Wmisleading-indentation): Add to -Wall for C and C++. gcc/ChangeLog: * doc/invoke.texi (-Wall): Add -Wmisleading-indentation to the list. (-Wmisleading-indentation): Update documentation to reflect being enabled by -Wall in C/C++. From-SVN: r231539 --- gcc/ChangeLog | 7 +++++++ gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c.opt | 2 +- gcc/doc/invoke.texi | 5 +++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8522ddc2a8..eabb30d4679 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-12-10 David Malcolm + + * doc/invoke.texi (-Wall): Add -Wmisleading-indentation to the + list. + (-Wmisleading-indentation): Update documentation to reflect + being enabled by -Wall in C/C++. + 2015-12-10 Vladimir Makarov PR rtl-optimization/68691 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 18ec7a1c747..0c8e74f3a06 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2015-12-10 David Malcolm + + * c.opt (Wmisleading-indentation): Add to -Wall for C and C++. + 2015-12-08 Jakub Jelinek PR c/48088 diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 6531d3af84d..5867de527fd 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -562,7 +562,7 @@ C ObjC C++ ObjC++ Var(warn_memset_transposed_args) Warning LangEnabledBy(C ObjC Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not. Wmisleading-indentation -C C++ Common Var(warn_misleading_indentation) Warning +C C++ Common Var(warn_misleading_indentation) Warning LangEnabledBy(C C++,Wall) Warn when the indentation of the code does not reflect the block structure. Wmissing-braces diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3f874292505..20a19e3828e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3556,6 +3556,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}. -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)} @gol -Wmaybe-uninitialized @gol -Wmemset-transposed-args @gol +-Wmisleading-indentation @r{(only for C/C++)} @gol -Wmissing-braces @r{(only for C/ObjC)} @gol -Wnarrowing @r{(only for C++)} @gol -Wnonnull @gol @@ -3903,8 +3904,6 @@ Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and @code{for} clauses with a guarded statement that does not use braces, followed by an unguarded statement with the same indentation. -This warning is disabled by default. - In the following example, the call to ``bar'' is misleadingly indented as if it were guarded by the ``if'' conditional. @@ -3934,6 +3933,8 @@ The warning is not issued after a @code{#line} directive, since this typically indicates autogenerated code, and no assumptions can be made about the layout of the file that the directive references. +This warning is enabled by @option{-Wall} in C and C++. + @item -Wmissing-braces @opindex Wmissing-braces @opindex Wno-missing-braces -- 2.30.2