Bug 1090016 - Part 4: Fix last gcc/clang warning in js/src/shell and mark as FAIL_ON_WARNINGS (for gcc/clang). r=njn
authorChris Peterson <cpeterson@mozilla.com>
Mon, 27 Oct 2014 21:25:02 -0700
changeset 213470 075c307bb073d0242215cfb42b8709483d0a9be8
parent 213469 4917409aa902ec928d0a5250ababc3962baf1e93
child 213471 54be5416ae5d568d5343cd015707243b0cb52e57
push id51240
push usercpeterson@mozilla.com
push dateSat, 01 Nov 2014 02:14:12 +0000
treeherdermozilla-inbound@4a4eb24614d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1090016
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1090016 - Part 4: Fix last gcc/clang warning in js/src/shell and mark as FAIL_ON_WARNINGS (for gcc/clang). r=njn
js/src/shell/js.cpp
js/src/shell/moz.build
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -2347,17 +2347,16 @@ DumpHeap(JSContext *cx, unsigned argc, j
     if (args.hasDefined(4)) {
         if (!args[2].isGCThing()) {
             JS_ReportError(cx, "dumpHeap: Fifth argument not a GC thing!");
             return false;
         }
         thingToIgnore = args[4];
     }
 
-
     FILE *dumpFile = stdout;
     if (fileName.length()) {
         dumpFile = fopen(fileName.ptr(), "w");
         if (!dumpFile) {
             JS_ReportError(cx, "dumpHeap: can't open %s: %s\n",
                           fileName.ptr(), strerror(errno));
             return false;
         }
@@ -2909,17 +2908,16 @@ static const JSClass resolver_class = {
     "resolver",
     JSCLASS_NEW_RESOLVE | JSCLASS_HAS_RESERVED_SLOTS(1),
     JS_PropertyStub,   JS_DeletePropertyStub,
     JS_PropertyStub,   JS_StrictPropertyStub,
     resolver_enumerate, (JSResolveOp)resolver_resolve,
     JS_ConvertStub
 };
 
-
 static bool
 Resolver(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject referent(cx);
     if (!JS_ValueToObject(cx, args.get(0), &referent))
         return false;
@@ -3239,16 +3237,17 @@ SetInterruptCallback(JSContext *cx, unsi
         return false;
     }
     *gInterruptFunc = value;
 
     args.rval().setUndefined();
     return true;
 }
 
+#ifdef DEBUG
 static bool
 StackDump(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     bool showArgs = ToBoolean(args.get(0));
     bool showLocals = ToBoolean(args.get(1));
     bool showThisProps = ToBoolean(args.get(2));
@@ -3259,17 +3258,17 @@ StackDump(JSContext *cx, unsigned argc, 
     } else {
         fputs(buf, gOutFile);
         JS_smprintf_free(buf);
     }
 
     args.rval().setUndefined();
     return true;
 }
-
+#endif
 
 static bool
 Elapsed(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length() == 0) {
         double d = 0.0;
         JSShellContextData *data = GetContextData(cx);
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -28,8 +28,11 @@ if CONFIG['_MSC_VER']:
     # for PGO.
     NO_PGO = True
 
 LOCAL_INCLUDES += ['..']
 GENERATED_INCLUDES += ['..']
 
 OS_LIBS += CONFIG['EDITLINE_LIBS']
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
+
+if CONFIG['GNU_CXX']:
+    FAIL_ON_WARNINGS = True