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 <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Köhne 2024-05-27 15:11:35 +02:00
parent 54f2229714
commit a92f0e1a84

View File

@ -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