bmcweb: Fix a bunch of warnings
bmcweb classically has not taken a strong opinion on warnings. With
this commit, that policy is changing, and bmcweb will invoke the best
warnings we are able to enable, and turn on -Werror for all builds.
This is intended to reduce the likelihood of hard-to-debug situations
that the compiler coulve caught early on.
Change-Id: I57474410821e82666b3a108cfd0db7d070e8900a
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index bbed047..51895ee 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -49,7 +49,7 @@
{
public:
SensorsAsyncResp(crow::Response& response, const std::string& chassisId,
- const std::initializer_list<const char*> types,
+ const std::vector<const char*> types,
const std::string& subNode) :
res(response),
chassisId(chassisId), types(types), chassisSubNode(subNode)
@@ -539,11 +539,11 @@
auto interfaceProperties = interfacesDict.find(std::get<0>(p));
if (interfaceProperties != interfacesDict.end())
{
- auto valueIt = interfaceProperties->second.find(std::get<1>(p));
- if (valueIt != interfaceProperties->second.end())
+ auto valIt = interfaceProperties->second.find(std::get<1>(p));
+ if (valIt != interfaceProperties->second.end())
{
- const SensorVariant& valueVariant = valueIt->second;
- nlohmann::json& valueIt = sensor_json[std::get<2>(p)];
+ const SensorVariant& valueVariant = valIt->second;
+ nlohmann::json& jValueIt = sensor_json[std::get<2>(p)];
// Attempt to pull the int64 directly
const int64_t* int64Value = std::get_if<int64_t>(&valueVariant);
@@ -566,11 +566,11 @@
temp = temp * std::pow(10, scaleMultiplier);
if (forceToInt)
{
- valueIt = static_cast<int64_t>(temp);
+ jValueIt = static_cast<int64_t>(temp);
}
else
{
- valueIt = temp;
+ jValueIt = temp;
}
}
}
@@ -985,7 +985,7 @@
*/
void setSensorOverride(crow::Response& res, const crow::Request& req,
const std::vector<std::string>& params,
- const std::initializer_list<const char*> typeList,
+ const std::vector<const char*> typeList,
const std::string& chassisSubNode)
{