From: Friedemann Kleint Date: Mon, 6 Jul 2015 10:11:19 +0000 (+0200) Subject: Fix warning about returning address of local variable by MSVC2015 in qv4engine.cpp. X-Git-Tag: v5.5.90+alpha1~3^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7da45b21b76965e021e8a049715b1dee34081f7c;p=platform%2Fupstream%2Fqtdeclarative.git Fix warning about returning address of local variable by MSVC2015 in qv4engine.cpp. qtdeclarative\src\qml\jsruntime\qv4engine.cpp(179) : warning C4172: returning address of local variable or temporary: dummy Disable warning as using the address is intended. Change-Id: Ide894a8dc2fb94f11d0455723c46567c84d91f8d Reviewed-by: Simon Hausmann --- diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 0f2b44fac..e1282eeca 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -108,6 +108,9 @@ static ReturnedValue throwTypeError(CallContext *ctx) const int MinimumStackSize = 256; // in kbytes +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4172) // MSVC 2015: warning C4172: returning address of local variable or temporary: dummy + quintptr getStackLimit() { quintptr stackLimit; @@ -172,6 +175,7 @@ quintptr getStackLimit() int dummy; // this is inexact, as part of the stack is used when being called here, // but let's simply default to 1MB from where the stack is right now + // (Note: triggers warning C4172 as of MSVC 2015, returning address of local variable) stackLimit = reinterpret_cast(&dummy) - 1024*1024; #endif @@ -179,6 +183,7 @@ quintptr getStackLimit() return stackLimit + MinimumStackSize*1024; } +QT_WARNING_POP QJSEngine *ExecutionEngine::jsEngine() const {