From 8267df75fbd24afd169773f49f6285aad21399dc Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Thu, 14 Apr 2016 22:31:32 +0000 Subject: [PATCH] Disable 2 warnings occurring in release builds Because of using a jump in an asm block there is a warning regarding disabling global optimisations (for that function only) and as a result of that another warning about being unable to check for buffer overruns. To work around the warnings temporarily disable both (C4740 and C4748). Regression since e405bf160746f0fbf20fa29bbca5b3d0d99f9d0e. --- src/msw/stackwalk.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/msw/stackwalk.cpp b/src/msw/stackwalk.cpp index 4c86de102c..ae04b0bc6c 100644 --- a/src/msw/stackwalk.cpp +++ b/src/msw/stackwalk.cpp @@ -306,6 +306,18 @@ void wxStackWalker::WalkFromException(size_t maxDepth) #endif // wxUSE_ON_FATAL_EXCEPTION +#ifdef __VISUALC__ + #pragma warning(push) + + // "warning C4740: flow in or out of inline asm code suppresses global + // optimization" + #pragma warning(disable: 4740) + + // "warning C4748: /GS can not protect parameters and local variables from + // local buffer overrun because optimizations are disabled in function" + #pragma warning(disable: 4748) +#endif + void wxStackWalker::Walk(size_t skip, size_t maxDepth) { // This code is based on frames.cpp from Edd Dawson's dbg library @@ -348,5 +360,9 @@ void wxStackWalker::Walk(size_t skip, size_t maxDepth) WalkFrom(&ctx, skip, maxDepth); } +#ifdef __VISUALC__ + #pragma warning(pop) +#endif + #endif // wxUSE_STACKWALKER