This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: potential patch for gdb bug c++/20020


>>>>> "Bob" == Bob Steagall <bob.steagall.cpp@gmail.com> writes:

>> You should drop the '{' and '}' here for a single statement block.

Bob> Disagree.  The gdb coding standard document specifically calls out
Bob> lines of code,
Bob> not statements:

Bob>     "Any two or more lines in code should be wrapped in braces, even if they
Bob>      are comments, as they look like separate statements"

I think this is just slightly mis-worded -- Andrew's interpretation is
the prevailing one.  That is, no brace for:

  if (blah)
     function_call (spanning,
                    multiple,
                    lines);

... but do have braces for:

  if (blah)
    {
      /* Just a comment.  */
      anything ();
    }

I agree the patch is good.  I think a test case would be good to have,
unless for some reason it's difficult to write one.

Tom


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