This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: potential patch for gdb bug c++/20020
- From: Tom Tromey <tom at tromey dot com>
- To: Bob Steagall <bob dot steagall dot cpp at gmail dot com>
- Cc: andrew dot burgess at embecosm dot com, gdb-patches at sourceware dot org
- Date: Thu, 06 Dec 2018 14:07:20 -0700
- Subject: Re: potential patch for gdb bug c++/20020
- References: <CAOhs8xKxGGTqpuFd40wWA8O6i97Odc_dmG=csK1DAFf=TCnYbg@mail.gmail.com> <CAOhs8xLYMrhEp-8fC=6n5rHXyzHKR9ehYq9oZ3N=g-UHbA8_Cg@mail.gmail.com> <20181206192003.GZ18841@embecosm.com> <CAOhs8xKJXH0fTNmdGQuybNT=VCUO4c4iJZix4EhTATzer997vw@mail.gmail.com>
>>>>> "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