From: Joel E. Denny Date: Mon, 17 Nov 2008 15:36:28 +0000 (-0500) Subject: Fix last warning from --enable-gcc-warnings. X-Git-Tag: v2.5_rc1~277 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/10fa0146e2051fbd536fb69acd9634fea4b4fbde Fix last warning from --enable-gcc-warnings. * src/getargs.c (getargs): Don't assign const address to non-const pointer. (cherry picked from commit a8beef7e6a9f6b75fa249d59b4c79585190540b6) --- diff --git a/ChangeLog b/ChangeLog index e4c83d24..dcfd0a5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-17 Joel E. Denny + + Fix last warning from --enable-gcc-warnings. + * src/getargs.c (getargs): Don't assign const address to non-const + pointer. + 2008-11-17 Di-an Jan Handle --enable-gcc-warnings. diff --git a/src/getargs.c b/src/getargs.c index 45557733..fddc023b 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -527,11 +527,14 @@ getargs (int argc, char *argv[]) { char* name = optarg; char* value = strchr (optarg, '='); + char const * muscle_value = ""; if (value) - *value++ = 0; - else - value = ""; - muscle_percent_define_insert (name, command_line_location (), value); + { + *value++ = 0; + muscle_value = value; + } + muscle_percent_define_insert (name, command_line_location (), + muscle_value); } break;