Fix "make test-cp-name-parser"
authorPedro Alves <palves@redhat.com>
Wed, 8 Nov 2017 15:20:41 +0000 (15:20 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 8 Nov 2017 15:28:50 +0000 (15:28 +0000)
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
gdb/cp-name-parser.y

index 67f65c4bbc11373da03696ef53469a71c7e1b428..80dbb669b7e894a0070899d2a43301d9112738e4 100644 (file)
@@ -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.
index d430ae762d6d9ec6f1a96d8c7c07736c5da21c46..33ecf13794b8057b4530ca32f20fc8586d49f917 100644 (file)
@@ -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;