From 53f40b5029b91292fd529c2207ae6b2caafefe6c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Jul 2019 16:31:19 +0200 Subject: [PATCH] Update comment and documentation related to C4535 MSVC warning Update the compiler version in the comment and explain how/when to update it in the future. --- docs/contributing/how-to-add-new-msvs-version.md | 6 ++++++ include/wx/msw/seh.h | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/contributing/how-to-add-new-msvs-version.md b/docs/contributing/how-to-add-new-msvs-version.md index 864c6abb70..41906bb610 100644 --- a/docs/contributing/how-to-add-new-msvs-version.md +++ b/docs/contributing/how-to-add-new-msvs-version.md @@ -56,3 +56,9 @@ MSVS version: - Update `build/tools/msvs/officialbuild.bat` to support the new toolset version and also update `build/tools/msvs/buildall.bat` to call it with this new version (these files are used to build the official binaries for the releases). +- If necessary, i.e. if the warning C4535 appears when compiling + `src/msw/main.cpp` with the new version, check that this warning is still + harmless, i.e. that catching Win32 exceptions still works correctly (this + can be tested with the "Crash" menu item in the except sample) and update + the version check in `include/wx/msw/seh.h` to suppress this warning for the + new version too. diff --git a/include/wx/msw/seh.h b/include/wx/msw/seh.h index 15cdb98f40..2af8e59f08 100644 --- a/include/wx/msw/seh.h +++ b/include/wx/msw/seh.h @@ -54,9 +54,11 @@ // as division by 0 or access violation) to C++ pseudo-exceptions extern void wxSETranslator(unsigned int code, EXCEPTION_POINTERS *ep); - // up to VC 12 this warning ("calling _set_se_translator() requires /EHa") - // is harmless and it's easier to suppress it than deal with it as make/ - // project file level as it seems to be harmless + // This warning ("calling _set_se_translator() requires /EHa") seems to be + // harmless with all the supported MSVC versions (up to 14.2, a.k.a. MSVS + // 2019), i.e. SEH translator seems to work just fine without /EHa too, so + // suppress it here as it's easier to suppress it than deal with it at + // make/ project files level. #if __VISUALC__ < 2000 #pragma warning(disable: 4535) #endif