From a92f0e1a843f1cbcc2fdca1fa42f80ccc8b65e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Mon, 27 May 2024 15:11:35 +0200 Subject: [PATCH] qmake: Do not disable deprecation warnings for MSVC (C4996) Commit 0a76b6b in Qt 5.5.0 did move C4496 that warns about use of API marked with __declspec(deprecated), [[deprecated]] to level 4, effectively disabling the warning for Qt users. This was done to work around msvc warnings for standard API Microsoft considers insecure, like std::copy. Anyhow, this change also meant that users won't see warnings for other deprecated API - including warnings about deprecated API in Qt, which is especially crucial for the Qt 6 transition. The original issue was fixed in Qt headers already in Qt 5.6.1 (see commit 31c7b24aa5f57fb). Also the CMake integration never set C4496, so it should be safe to remove this now. [ChangeLog][qmake] qmake does not disable the MSVC compiler warning about deprecated API by default anymore (C4996). This means the compiler will now warn about use of deprecated API, be it from Qt or from other headers. You can manually revert this by adding QMAKE_CXX_FLAGS_WARN_ON += -wd4996 to your .pro file. Fixes: QTBUG-85227 Change-Id: I5a578d34370e0e5e8a91f8a31e96b9c532dde8b5 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- mkspecs/common/msvc-desktop.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index 68980ff5cf9..72fe0ec34e1 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -60,7 +60,7 @@ QMAKE_CFLAGS_SHANI = $$QMAKE_CFLAGS_SSE2 QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 -w44996 +QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO