From 2e3baf1911295ffde78edf09c594ca04697b981f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 19 Dec 2022 12:36:38 +0100 Subject: [PATCH] Suppress a silly MSVC warning for an empty switch. Well, guess why I have it there. --- src/Magnum/ImageFlags.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Magnum/ImageFlags.cpp b/src/Magnum/ImageFlags.cpp index a7e8a6c64..1b55d8062 100644 --- a/src/Magnum/ImageFlags.cpp +++ b/src/Magnum/ImageFlags.cpp @@ -35,12 +35,22 @@ Debug& operator<<(Debug& debug, const ImageFlag1D value) { if(!packed) debug << "ImageFlag1D" << Debug::nospace; + /* MSVC, I want to have the switch here even if it's empty so I'm notified + when there are new values that I should handle. Don't complain. */ + /** @todo drop this once there are values */ + #ifdef CORRADE_TARGET_MSVC + #pragma warning(push) + #pragma warning(disable: 4060) + #endif switch(value) { /* LCOV_EXCL_START */ #define _c(value) case ImageFlag1D::value: return debug << (packed ? "" : "::") << Debug::nospace << #value; #undef _c /* LCOV_EXCL_STOP */ } + #ifdef CORRADE_TARGET_MSVC + #pragma warning(pop) + #endif return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); }