This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] tree-parloops.c (eliminate_local_variables): Add braces to suppress warnings


On Apr 13, 2012, at 7:50 AM, Bernd Schmidt wrote:
> The problem is that a human might be
> confused, for example due to bad indentation. Whether there's a for in
> between doesn't matter for this purpose, the following is most likely a bug:
> 
> if ()
>  for (..)
>    if ()
>      x
> else
>  y

I like the warning only when the indentation of the else does not match the indentation of the matching if.  Most humans I think can follow the meaning correctly, if the code is indented correctly.  The point of the warning would be to catch typos, and an else that isn't in the right column, is most likely wrong.  Though, I'd argue that any else in the wrong column, is most likely wrong...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]