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.
This commit is contained in:
Terrence Cole 2012-09-11 12:31:04 -07:00
parent 3fe1c2ffd0
commit b3325f556e
2 changed files with 6 additions and 5 deletions

View File

@ -1231,6 +1231,7 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
RootedPropertyName rootName0(cx); RootedPropertyName rootName0(cx);
RootedId rootId0(cx); RootedId rootId0(cx);
RootedShape rootShape0(cx); RootedShape rootShape0(cx);
DebugOnly<uint32_t> blockDepth;
if (!entryFrame) if (!entryFrame)
entryFrame = regs.fp(); entryFrame = regs.fp();
@ -3650,7 +3651,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCK)
BEGIN_CASE(JSOP_LEAVEFORLETIN) BEGIN_CASE(JSOP_LEAVEFORLETIN)
BEGIN_CASE(JSOP_LEAVEBLOCKEXPR) BEGIN_CASE(JSOP_LEAVEBLOCKEXPR)
{ {
DebugOnly<uint32_t> blockDepth = regs.fp()->blockChain().stackDepth(); blockDepth = regs.fp()->blockChain().stackDepth();
regs.fp()->popBlock(cx); regs.fp()->popBlock(cx);

View File

@ -432,10 +432,10 @@ typedef size_t jsbitmap;
#if defined(__clang__) #if defined(__clang__)
# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \
JS_BEGIN_MACRO \ JS_BEGIN_MACRO \
_Pragma("clang diagnostic push") \ _Pragma("(clang diagnostic push)") \
_Pragma("clang diagnostic ignored \"-Wunused-value\"") \ _Pragma("(clang diagnostic ignored \"-Wunused-value\")") \
expr; \ {expr;} \
_Pragma("clang diagnostic pop") \ _Pragma("(clang diagnostic pop)") \
JS_END_MACRO JS_END_MACRO
#elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \