Fix GCC bogus opt-only warning in jsoptparse.cpp. no_r=me.
authorJason Orendorff <jorendorff@mozilla.com>
Sat, 13 Aug 2011 07:00:33 -0500
changeset 75258 40012d42600c4d6c6a39777f1319f5d1dee819b4
parent 75257 1da81e7e7c753aea1180dd14cef10ff2d2792bd9
child 75259 f9fc17cd224eaccbcca75d2be8d99bf9455ed928
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone8.0a1
Fix GCC bogus opt-only warning in jsoptparse.cpp. no_r=me.
js/src/shell/jsoptparse.cpp
--- a/js/src/shell/jsoptparse.cpp
+++ b/js/src/shell/jsoptparse.cpp
@@ -295,33 +295,33 @@ OptionParser::handleOption(Option *opt, 
         return Okay;
       }
       /* 
        * Valued options are allowed to specify their values either via
        * successive arguments or a single --longflag=value argument.
        */
       case OptionKindString:
       {
-        char *value;
+        char *value = NULL;
         if (Result r = extractValue(argc, argv, i, &value))
             return r;
         opt->asStringOption()->value = value;
         return Okay;
       }
       case OptionKindInt:
       {
-        char *value;
+        char *value = NULL;
         if (Result r = extractValue(argc, argv, i, &value))
             return r;
         opt->asIntOption()->value = atoi(value);
         return Okay;
       }
       case OptionKindMultiString:
       {
-        char *value;
+        char *value = NULL;
         if (Result r = extractValue(argc, argv, i, &value))
             return r;
         StringArg arg(value, *i);
         return opt->asMultiStringOption()->strings.append(arg) ? Okay : Fail;
       }
       default:
         JS_NOT_REACHED("unhandled option kind");
         return Fail;