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: Bob Steagall <bob dot steagall dot cpp at gmail dot com>
- To: tom at tromey dot com
- Cc: andrew dot burgess at embecosm dot com, gdb-patches at sourceware dot org
- Date: Fri, 7 Dec 2018 07:52:11 -0500
- 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> <87va46cqk7.fsf@tromey.com>
OK, I will update to include both suggestions.
Regarding the test case, I don't know how to write a unit test case if
that's what you're asking for. However, there are directions for
reproducing the problem I experience in my original bug report
c++/23953 (subsequently closed as a duplicate of 20020).
I'll send the updated patch momentarily.
--Bob
On Thu, Dec 6, 2018 at 4:07 PM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "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