POSITION pos;
CSelectedDays* pt;
pos = m_pCalendarIntervalDays->GetHeadPosition();
while (pos != NULL)
{
BOOL timeCodeMatches = FALSE;
pt = (CSelectedDays*)m_pCalendarIntervalDays->GetNext(pos);
Value stored to 'pt' is never read <<<<<<<<<<<SONAR QUBE ISSUE
for each (CBulkOverrideDays * bulkOverrideDay in pt->m_BulkOverrideDays)
{
timeCodeMatches = pt->HoursAppliesToAllTimeCodes();
This is one example where SonarQube thinks the variable pt is not being used, yet it is used in the for loop
I believe there should be a parse error around that line looking like expected ‘(’ after ‘for’.
Once fixed, the issue you mentioned should be gone too.
Quoting Microsoft documentation on for each:
This non-standard keyword is available in both C++/CLI and native C++ projects. However, its use isn’t recommended. Consider using a standard Range-based for Statement (C++) instead.