Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location
Date: Tue, 04 Oct 2016 10:50:00 -0000	[thread overview]
Message-ID: <CAH=s-PNCVUHE1O540d8rMnZvyYsKMS=9U_UOT7y-nOnz72_LAQ@mail.gmail.com> (raw)
In-Reply-To: <1475531646-18049-3-git-send-email-tom@tromey.com>

On Mon, Oct 3, 2016 at 10:54 PM, Tom Tromey <tom@tromey.com> wrote:
> This bug points out that string_to_explicit_location compares a char*
> against '\0'; whereas comparing against NULL is more normal.
>
> 2016-10-03  Tom Tromey  <tom@tromey.com>
>
>         PR breakpoints/20653:
>         * location.c (string_to_explicit_location): Use NULL, not '\0'.

Patch is good to me.

GCC trunk can capture it by a warning like this,

../../binutils-gdb/gdb/location.c: In function ‘event_location*
string_to_explicit_location(const char**, const language_defn*, int)’:
../../binutils-gdb/gdb/location.c:527:19: error: ISO C++ forbids
comparison between pointer and integer [-fpermissive]
       || *argp == '\0'
                   ^~~~
make: *** [location.o] Error 1

-- 
Yao (齐尧)


  parent reply	other threads:[~2016-10-04 10:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 21:54 [RFA 0/3] Fix various bugs found by static analysis Tom Tromey
2016-10-03 21:54 ` [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location Tom Tromey
2016-10-03 22:27   ` Keith Seitz
2016-10-04 10:50   ` Yao Qi [this message]
2016-10-03 21:54 ` [RFA 1/3] PR symtab/20652 - fix psymbol_compare Tom Tromey
2016-10-04 10:55   ` Yao Qi
2016-10-04 18:37   ` Pedro Alves
2016-10-04 18:52     ` Tom Tromey
2016-10-03 21:54 ` [RFA 3/3] PR remote/20655 - small fix in handle_tracepoint_bkpts Tom Tromey
2016-10-04 12:53   ` Yao Qi
2016-10-04 15:14 ` [RFA 0/3] Fix various bugs found by static analysis Yao Qi
2016-10-04 18:31   ` Pedro Alves
2016-10-04 19:05     ` Eli Zaretskii
2016-10-04 20:43       ` Tom Tromey
     [not found] <VI1PR0801MB2031F8BBE482E30DC339C2E1FFC70@VI1PR0801MB2031.eurprd08.prod.outlook.com>
2016-10-06  9:10 ` [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location Tamar Christina
2016-10-06 15:36 ` Tom Tromey
2016-10-06 15:42   ` Tamar Christina
     [not found]   ` <CAH=s-PNRhbe9pypkm4=VwCo_Y+CNwcW1PCjC=vBeb2Us7tUHWQ@mail.gmail.com>
2016-10-24 11:10     ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH=s-PNCVUHE1O540d8rMnZvyYsKMS=9U_UOT7y-nOnz72_LAQ@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox