Fix "make test-cp-name-parser"

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.
This commit is contained in:
Pedro Alves 2017-11-08 15:20:41 +00:00
parent 2841837fac
commit 2a1dde5da2
2 changed files with 5 additions and 1 deletions

View 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.

View 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;