diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index 9a377960..68cbd512 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -252,8 +252,8 @@ inline SIZE_T SIZETAdd(SIZE_T a, SIZE_T b) /// /// \returns Number of characters in result. /// -[[deprecated("Behavior of this function changed from append to assign. Please, review call usage.")]] template +[[deprecated("Behavior of this function changed from append to assign. Please, review call usage.")]] static int vsprintf(_Inout_ std::basic_string &str, _In_z_ _Printf_format_string_ const char *format, _In_ va_list arg) { char buf[WINSTD_STACK_BUFFER_BYTES/sizeof(char)]; @@ -291,8 +291,8 @@ static int vsprintf(_Inout_ std::basic_string &str, _In_z_ _ /// /// \returns Number of characters in result. /// -[[deprecated("Behavior of this function changed from append to assign. Please, review call usage.")]] template +[[deprecated("Behavior of this function changed from append to assign. Please, review call usage.")]] static int vsprintf(_Inout_ std::basic_string &str, _In_z_ _Printf_format_string_ const wchar_t *format, _In_ va_list arg) { wchar_t buf[WINSTD_STACK_BUFFER_BYTES/sizeof(wchar_t)]; @@ -1312,6 +1312,7 @@ namespace winstd va_list arg; va_start(arg, wLanguage); std::wstring sMessage; +#pragma warning(suppress: 4996) // Checked to comply. vsprintf(sMessage, szFormat, arg); va_end(arg); WideCharToMultiByte(CP_UTF8, 0, sMessage, sResult, NULL, NULL); @@ -1498,6 +1499,7 @@ namespace winstd { va_list arg; va_start(arg, format); +#pragma warning(suppress: 4996) // Checked to comply. vsprintf(*this, format, arg); va_end(arg); } diff --git a/include/WinStd/Win.h b/include/WinStd/Win.h index 55fff26a..95ce8283 100644 --- a/include/WinStd/Win.h +++ b/include/WinStd/Win.h @@ -739,7 +739,8 @@ static _Success_(return != 0) int LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ static VOID OutputDebugStrV(_In_z_ LPCSTR lpOutputString, _In_ va_list arg) noexcept { std::string str; - try { vsprintf(str, lpOutputString, arg); } catch (...) { return; } +#pragma warning(suppress: 4996) // Checked to comply. + try { vsprintf(str, lpOutputString, arg); } catch (...) { return; } OutputDebugStringA(str.c_str()); } @@ -751,7 +752,8 @@ static VOID OutputDebugStrV(_In_z_ LPCSTR lpOutputString, _In_ va_list arg) noex static VOID OutputDebugStrV(_In_z_ LPCWSTR lpOutputString, _In_ va_list arg) noexcept { std::wstring str; - try { vsprintf(str, lpOutputString, arg); } catch (...) { return; } +#pragma warning(suppress: 4996) // Checked to comply. + try { vsprintf(str, lpOutputString, arg); } catch (...) { return; } OutputDebugStringW(str.c_str()); }