In src/xml_parsing.cpp, inside XMLParser::PImpl::createNodeFromXML(), port_name and port_value are declared twice within the same loop iteration. The outer declarations (lines 805–806) are immediately shadowed by identical re-declarations inside the if(IsAllowedPortName(port_name)) block (lines 809–810):
for(const XMLAttribute* att = element->FirstAttribute(); att != nullptr; att = att->Next())
{
const std::string port_name = att->Name(); // declared here
const std::string port_value = att->Value(); // declared here
if(IsAllowedPortName(port_name))
{
const std::string port_name = att->Name(); // redundant — shadows outer
const std::string port_value = att->Value(); // redundant — shadows outer
...
}
}
The inner variables have exactly the same values as the outer ones and serve no purpose. The fix is to remove lines 809–810.
In src/xml_parsing.cpp, inside XMLParser::PImpl::createNodeFromXML(), port_name and port_value are declared twice within the same loop iteration. The outer declarations (lines 805–806) are immediately shadowed by identical re-declarations inside the if(IsAllowedPortName(port_name)) block (lines 809–810):
The inner variables have exactly the same values as the outer ones and serve no purpose. The fix is to remove lines 809–810.