Bug 17946 - remote.c:5668 possible bad if test ?
Summary: remote.c:5668 possible bad if test ?
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-09 12:50 UTC by dcb
Modified: 2015-02-10 00:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dcb 2015-02-09 12:50:05 UTC
[binutils-gdb/gdb/remote.c:5668]: (warning) Char literal compared with pointer 'p'. Did you intend to dereference it?

        if (p == '\0')
          ;

Maybe
        if (*p == '\0')
          ;

was intended.
Comment 1 Sourceware Commits 2015-02-10 00:01:52 UTC
The master branch has been updated by Sergio Durigan Junior <sergiodj@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0b24eb2de5a6dbefe48fd57fcf5d0e7fb24895d4

commit 0b24eb2de5a6dbefe48fd57fcf5d0e7fb24895d4
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Mon Feb 9 18:58:12 2015 -0500

    PR remote/17946: Fix wrong comparison of pointer against char
    
    We were comparing a pointer against a char on remote.c.  'dcb' filed a
    bug to inform us about that.  I pushed the following patch under the
    obvious rule.
    
    gdb/ChangeLog:
    2015-02-09  Sergio Durigan Junior  <sergiodj@redhat.com>
    
    	PR remote/17946
    	* gdb/remote.c (remote_parse_stop_reply): Fix wrong comparison
    	of pointer against char.
Comment 2 Sergio Durigan Junior 2015-02-10 00:02:11 UTC
Thanks for the report.  The bug has been fixed.