From dfa36f048f826571daefa9599d20db0c4fc5e085 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Tue, 11 Sep 2012 12:31:04 -0700 Subject: [PATCH] Bug 784631 - Fix some clang build errors in SpiderMonkey; r=Waldo f=espindola Computed gotos are not in the C++ standard: clang and gcc differ on semantics. --- js/src/jsinterp.cpp | 3 ++- js/src/jsutil.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 0094c726889..27a64a72971 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -1231,6 +1231,7 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode) RootedPropertyName rootName0(cx); RootedId rootId0(cx); RootedShape rootShape0(cx); + DebugOnly blockDepth; if (!entryFrame) entryFrame = regs.fp(); @@ -3650,7 +3651,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCK) BEGIN_CASE(JSOP_LEAVEFORLETIN) BEGIN_CASE(JSOP_LEAVEBLOCKEXPR) { - DebugOnly blockDepth = regs.fp()->blockChain().stackDepth(); + blockDepth = regs.fp()->blockChain().stackDepth(); regs.fp()->popBlock(cx); diff --git a/js/src/jsutil.h b/js/src/jsutil.h index 8838b6f70b0..016a877d1b6 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -432,10 +432,10 @@ typedef size_t jsbitmap; #if defined(__clang__) # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ JS_BEGIN_MACRO \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ - expr; \ - _Pragma("clang diagnostic pop") \ + _Pragma("(clang diagnostic push)") \ + _Pragma("(clang diagnostic ignored \"-Wunused-value\")") \ + {expr;} \ + _Pragma("(clang diagnostic pop)") \ JS_END_MACRO #elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \