From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57351 invoked by alias); 4 Oct 2016 10:50:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 57335 invoked by uid 89); 4 Oct 2016 10:50:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f66.google.com Received: from mail-oi0-f66.google.com (HELO mail-oi0-f66.google.com) (209.85.218.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Oct 2016 10:50:26 +0000 Received: by mail-oi0-f66.google.com with SMTP id o93so1635689oik.0 for ; Tue, 04 Oct 2016 03:50:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yhHlqik5mA7UU+K65msc7TMQXKFp0YeIo5oGU7Honkk=; b=D4uUF2A7Hw1V6SrU5BulfcjwKc3Zfew2y5+198Lig9G/C3zS+dTgymZKIeC2E3ZXva h6y8F85YA8pBc0fIqgFPYIGnFFurPx6f4GP7fTggcK1RkmQcHWG2tvxIgntyw7uDUJIf RfPkf2/WYN9nw0dtHq2NzFzOylXZKOS9y8E/ySTtFIFlTR9W6Q/uipll/E+1zuQE0j8R Y8i1376MEe/6VoGhwIUPhd40uVSEtDt/GYu3NKeG1b8xdie20j2JpNiaBdJgjTZKgtJH mW7eVagm7N+XcPVPWN5cg81qjdWo8a1d8JDpTa6aYm8rVdgPHWvGJD5WNbmjGJABLCvC 0KHQ== X-Gm-Message-State: AA6/9RnIPaocsFVON0u0KAJVuloarZWBIk+ZRdYfvm3mlfrvlsWAgYB9CfM4XSdu7Ijk1unySxe8SRrHT1zyMQ== X-Received: by 10.202.82.7 with SMTP id g7mr2494337oib.112.1475578225093; Tue, 04 Oct 2016 03:50:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.221.3 with HTTP; Tue, 4 Oct 2016 03:50:24 -0700 (PDT) In-Reply-To: <1475531646-18049-3-git-send-email-tom@tromey.com> References: <1475531646-18049-1-git-send-email-tom@tromey.com> <1475531646-18049-3-git-send-email-tom@tromey.com> From: Yao Qi Date: Tue, 04 Oct 2016 10:50:00 -0000 Message-ID: Subject: Re: [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location To: Tom Tromey Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00037.txt.bz2 On Mon, Oct 3, 2016 at 10:54 PM, Tom Tromey 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 > > 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 =E2=80=98event_location* string_to_explicit_location(const char**, const language_defn*, int)=E2=80= =99: ../../binutils-gdb/gdb/location.c:527:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] || *argp =3D=3D '\0' ^~~~ make: *** [location.o] Error 1 --=20 Yao (=E9=BD=90=E5=B0=A7)