From patchwork Wed Nov 8 15:36:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 24154 Received: (qmail 10357 invoked by alias); 8 Nov 2017 15:36:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10348 invoked by uid 89); 8 Nov 2017 15:36:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1256 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Nov 2017 15:36:04 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5EAE90C77 for ; Wed, 8 Nov 2017 15:36:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A5EAE90C77 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D2BB619C8 for ; Wed, 8 Nov 2017 15:36:02 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix "make test-cp-name-parser" Date: Wed, 8 Nov 2017 15:36:02 +0000 Message-Id: <1510155362-10535-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 src/gdb/cp-name-parser.y: In function ‘int main(int, char**)’: src/gdb/cp-name-parser.y:2132:30: error: ISO C++ forbids converting a string constant to ‘char*’ [-Werror=write-strings] char *str2, *extra_chars = "", c; ^ Simply don't initialize the variable, it's not necessary. gdb/ChangeLog: 2017-11-08 Pedro Alves * cp-name-parser.y (main): Don't initialize extra_chars. --- gdb/ChangeLog | 4 ++++ gdb/cp-name-parser.y | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67f65c4..80dbb66 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-11-08 Pedro Alves + + * cp-name-parser.y (main): Don't initialize extra_chars. + 2017-11-07 Tom Tromey * event-top.h (command_handler): Constify. diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index d430ae7..33ecf13 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -2129,7 +2129,7 @@ internal_error (const char *file, int line, const char *fmt, ...) int main (int argc, char **argv) { - char *str2, *extra_chars = "", c; + char *str2, *extra_chars, c; char buf[65536]; int arg; const char *errmsg;