Clear warning suppression

Code analysis got quite good and we'd better keep warnings on our radar.

Either:
1. Research and resolve the reason for the warning.
2. Remove silencing and let code analysis complain.
3. Comment why some warning silencing is there.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-04-01 15:18:43 +02:00
parent 6607f20873
commit 2e03659948
5 changed files with 4 additions and 20 deletions

View File

@ -1718,10 +1718,8 @@ namespace winstd
// Fill in BITMAPFILEHEADER.
memset(header, 0, sizeof(*header));
#pragma warning(push)
#pragma warning(disable: 6276) // "BM" is not an UTF16 char.
#pragma warning(suppress: 6276) // "BM" is not an UTF16 char.
header->bfType = *reinterpret_cast<WORD*>("BM");
#pragma warning(pop)
header->bfSize = static_cast<DWORD>(sizeof(*header) + sizeof(bmh) + pallete_size + bmh.biSizeImage);
header->bfOffBits = static_cast<DWORD>(sizeof(*header) + sizeof(bmh) + pallete_size);
@ -1749,7 +1747,7 @@ namespace winstd
/// \param[in] locale Locale for the invoke call
///
template <class T>
void IDispatchInvoke(_In_ T* cp, _In_ DISPID id, _In_opt_ DISPPARAMS* param, _In_ LCID locale = LOCALE_USER_DEFAULT)
void IDispatchInvoke(_In_ T* cp, _In_ DISPID id, _In_ DISPPARAMS* param, _In_ LCID locale = LOCALE_USER_DEFAULT)
{
assert(cp);
com_obj<IEnumConnections> e;

View File

@ -1207,7 +1207,7 @@ namespace winstd
///
/// \param[inout] h A rvalue reference of another object
///
#pragma warning(disable: 26432) // Move constructor is also present, but not detected by code analysis somehow.
#pragma warning(suppress: 26432) // Move constructor is also present, but not detected by code analysis somehow.
dplhandle<handle_type, INVAL>& operator=(_Inout_ dplhandle<handle_type, INVAL> &&h) noexcept
{
handle<handle_type, INVAL>::operator=(std::move(h));

View File

@ -74,7 +74,7 @@ namespace winstd
///
/// \sa [Extensible Authentication Protocol (EAP) Registry (Chapter: Method Types)](https://www.iana.org/assignments/eap-numbers/eap-numbers.xhtml#eap-numbers-4)
///
#pragma warning(suppress: 4480)
#pragma warning(suppress: 4480) // Prefering enums over #define for constants
enum class eap_type_t : unsigned char {
undefined = 0, ///< Undefined EAP type
identity = 1, ///< Identity
@ -319,8 +319,6 @@ namespace winstd
nKeySize + // Key
nPaddingLength; // Padding
#pragma warning(push)
#pragma warning(disable: 6386)
LPBYTE p = new BYTE[dwLengthNew];
p[0] = 0x00; // Vendor-Id (0x137 = 311 = Microsoft)
p[1] = 0x00; // --|
@ -331,7 +329,6 @@ namespace winstd
p[6] = 0x00; // Salt
p[7] = 0x00; // --^
p[8] = nKeySize; // Key-Length
#pragma warning(pop)
memcpy(p + 9, pbKey, nKeySize); // Key
memset(p + 9 + nKeySize, 0, nPaddingLength); // Padding

View File

@ -600,10 +600,7 @@ namespace winstd
}
va_end(arg);
#pragma warning(push)
#pragma warning(disable: 28020)
return EventWrite(m_h, EventDescriptor, param_count, params.data());
#pragma warning(pop)
}
///
@ -644,10 +641,7 @@ namespace winstd
params.push_back(p);
}
#pragma warning(push)
#pragma warning(disable: 28020)
return EventWrite(m_h, EventDescriptor, param_count, params.data());
#pragma warning(pop)
}
///

View File

@ -1913,16 +1913,11 @@ namespace winstd
///
~process_information()
{
#pragma warning(push)
#pragma warning(disable: 6001) // Using uninitialized memory '*this'. << ???
if (hProcess != INVALID_HANDLE_VALUE)
CloseHandle(hProcess);
if (hThread != INVALID_HANDLE_VALUE)
CloseHandle(hThread);
#pragma warning(pop)
}
};