public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [pushed] Fix "make test-cp-name-parser"
Date: Wed, 08 Nov 2017 15:36:00 -0000	[thread overview]
Message-ID: <1510155362-10535-1-git-send-email-palves@redhat.com> (raw)

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  <palves@redhat.com>

	* 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  <palves@redhat.com>
+
+	* cp-name-parser.y (main): Don't initialize extra_chars.
+
 2017-11-07  Tom Tromey  <tom@tromey.com>
 
 	* 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;
-- 
2.5.5

                 reply	other threads:[~2017-11-08 15:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1510155362-10535-1-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).