From 143113dbf27711dc2a78b13d2d0a43ee50b02072 Mon Sep 17 00:00:00 2001 From: Maximilian Starke Date: Sat, 18 Nov 2023 23:28:17 +0100 Subject: [PATCH] workaround for the MSVC / Visual Studio bug of its latest version --- src/logger.cpp | 1 + src/main.cpp | 2 +- src/mainwindow.cpp | 2 +- src/predefined.h | 7 +++++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/predefined.h diff --git a/src/logger.cpp b/src/logger.cpp index 4f9d36df..d0623df8 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,3 +1,4 @@ +#include "predefined.h" #include "logger.h" #include "internal_error.h" diff --git a/src/main.cpp b/src/main.cpp index 4266e9ab..981e7cf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ - +#include "predefined.h" #include "logger.h" #include "mainwindow.h" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d36b7f19..50dce2d5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,4 +1,4 @@ - +#include "predefined.h" #include "mainwindow.h" #include "./ui_mainwindow.h" #include diff --git a/src/predefined.h b/src/predefined.h new file mode 100644 index 00000000..cc06c6e0 --- /dev/null +++ b/src/predefined.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef _MSC_VER +//1 > C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xutility(1141, 31) : warning C4996 : 'stdext::checked_array_iterator' : warning STL4043 : stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory functions are non - Standard extensions and will be removed in the future.std::span(since C++20) and gsl::span can be used instead.You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning. +#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING +#endif // _MSC_VER +