This is the mail archive of the
mailing list for the GDB project.
Re: [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location
On Mon, Oct 3, 2016 at 10:54 PM, Tom Tromey <firstname.lastname@example.org> 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 <email@example.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