Menu

I'm getting a lot of warnings on WTL objects.

Help
2022-08-17
2022-08-19
  • Roger S. Keay

    Roger S. Keay - 2022-08-17

    I am using WTL 10320 and Visual Studio 2019. Here are the warnings I'm getting. I'm using C++14 Windows SDK Version 10.0 (latest) Unicode character set and debug libraries. NOt sure where to go with this as I don't want to start messing with the headers.

    Severity Code Description Project File Line Suppression State
    Warning C26110 Caller failing to hold lock '(&this->m_cslock)->m_cs' before calling function 'ATL::CComCritSecLock<atl::ccomcriticalsection>::Unlock'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atlapp.h 759
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 248
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 249
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 250
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 251
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 252
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 253
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 254
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 255
    Warning C6387 'pT->m_hWnd' could be '0': this does not adhere to the specification for the function 'ATL::CMessageMap::ProcessWindowMessage'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 1569
    Warning C6387 'pT->m_hWnd' could be '0': this does not adhere to the specification for the function 'ATL::CMessageMap::ProcessWindowMessage'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atldlgs.h 2024
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atlframe.h 647
    Warning C26454 Arithmetic overflow: '-' operation produces a negative unsigned result at compile time (io.5). Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atlframe.h 648
    Warning C6387 'hFont' could be '0': this does not adhere to the specification for the function 'SelectObject'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atlgdi.h 1326
    Warning C6387 'hBitmap' could be '0': this does not adhere to the specification for the function 'SelectObject'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atlgdi.h 1333
    Warning C6001 Using uninitialized memory 'lpstrMessage'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atluser.h 65
    Warning C6001 Using uninitialized memory 'lpstrTitle'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atluser.h 86
    Warning C6387 'lpCursorName' could be '0': this does not adhere to the specification for the function 'LoadCursorW'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atluser.h 1135
    Warning C6387 'lpIconName' could be '0': this does not adhere to the specification for the function 'LoadIconW'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atluser.h 1153
    Warning C6001 Using uninitialized memory 'lpstrText'. Kick Firmware Update Utility C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\WTL\Include\atluser.h 1210
    Warning C26812 The enum type 'CSerial::EDataBits' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). Kick Firmware Update Utility F:\Visual Studio Repos\Kick Firmware Update Utility\CComReadWrite.h 57 </atl::ccomcriticalsection>

     
  • Roger S. Keay

    Roger S. Keay - 2022-08-19

    Sorry for the confusion. I have been looking at this some more. This seems to be an artifact of Code Analysis on older code. Perhaps an issue with Microsoft CA not recognizing certain macros? I massaged it away by suppressing the warnings in the solution configuration settings. I could also probably use #pragma push/pop around the headers instead.

     

    Last edit: Roger S. Keay 2022-08-21

Log in to post a comment.