diff --git a/stl/inc/xlocinfo b/stl/inc/xlocinfo index 290596d8bd..e71846c183 100644 --- a/stl/inc/xlocinfo +++ b/stl/inc/xlocinfo @@ -183,10 +183,12 @@ public: template , int> = 0> void _From_wide(const wchar_t* const _Right) noexcept { + // CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781 if (reinterpret_cast(_Myptr) != _Right) { // new value, discard old and copy new _Tidy(); if (_Right) { // new is not empty, copy it + // CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781 _Myptr = reinterpret_cast(_STD _Ntcts_dup_dbg(_Right)); } } diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index e47b4e9094..7b176a1edc 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -236,6 +236,7 @@ void __CLRCALL_PURE_OR_CDECL _Locinfo::_Locinfo_dtor(_Locinfo* pLocinfo) { // de // so reinterpret_cast is not reliable. _wsetlocale(LC_ALL, L""); } else { + // CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781 _wsetlocale(LC_ALL, reinterpret_cast(pLocinfo->_Oldlocname._C_str())); } }