From a9300f2c342eb73b3af9b7aa271dea2f3159d7b2 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 16 Mar 2021 17:12:18 +0100 Subject: [PATCH] Suppress warning (MSVC, C4250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This design decision was intentional and reflects the fact that we cannot have inheritance tree 'linear' as before, since the base interface is an abstract class without any data-members. Also, fix a warning about size_t -> int implicit conversion. Fixes: QTBUG-91866 Change-Id: Icbc73c22d8adf72bbd8949125d4404ea6da69c6d Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 1a7faeef94dcf6826c6ee564a1bfb31ebb952e56) --- src/network/ssl/qdtls_openssl.cpp | 2 +- src/network/ssl/qdtls_openssl_p.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/network/ssl/qdtls_openssl.cpp b/src/network/ssl/qdtls_openssl.cpp index 80b5179f695..fe6c8013c7d 100644 --- a/src/network/ssl/qdtls_openssl.cpp +++ b/src/network/ssl/qdtls_openssl.cpp @@ -1273,7 +1273,7 @@ unsigned QDtlsPrivateOpenSSL::pskClientCallback(const char *hint, char *identity } QTlsBackend::setupClientPskAuth(&authenticator, hint ? identityHint.constData() : nullptr, - hint ? std::strlen(hint) : 0, max_identity_len, max_psk_len); + hint ? int(std::strlen(hint)) : 0, max_identity_len, max_psk_len); pskAuthenticator.swap(authenticator); } diff --git a/src/network/ssl/qdtls_openssl_p.h b/src/network/ssl/qdtls_openssl_p.h index 6e9e59cbd23..281e1133cd6 100644 --- a/src/network/ssl/qdtls_openssl_p.h +++ b/src/network/ssl/qdtls_openssl_p.h @@ -58,6 +58,7 @@ #include #include +#include #include #include @@ -134,6 +135,13 @@ private: } // namespace dtlsopenssl +// The trick with 'right' ancestor in the tree overriding (only once) some shared +// virtual functions is intentional. Too bad MSVC warns me about ... exactly the +// feature of C++ that I want to use. + +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4250) + class QDtlsClientVerifierOpenSSL : public QTlsPrivate::DtlsCookieVerifier, public QDtlsBasePrivate { public: @@ -236,6 +244,8 @@ private: QByteArray identityHint; }; +QT_WARNING_POP // C4250 + QT_END_NAMESPACE #endif // QDTLS_OPENSSL_P_H