Wshadow warnings
I wasted time on figuring out why a test fails just to see that the wrong variable with the same name declared in a nested scope was used. Since then, I'm passing -Wshadow
to my compilation flags to detect such situations beforehand. I would like to reduce the noise outputted by these warnings throughout the Kea code. There are several. Here is one of them:
data.cc: In member function ‘virtual void isc::data::MapElement::toJSON(std::ostream&) const’:
data.cc:900:51: warning: declaration of ‘m’ shadows a member of ‘isc::data::MapElement’ [-Wshadow]
900 | const std::map<std::string, ConstElementPtr>& m = mapValue();
| ^
In file included from data.cc:9:
../../../src/lib/cc/data.h:702:44: note: shadowed declaration is here
702 | std::map<std::string, ConstElementPtr> m;
|