diff options
author | Ed Tanous <ed@tanous.net> | 2020-07-25 07:45:05 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-08-17 23:54:37 +0300 |
commit | 23a21a1cbed23ace4174664950e595df961e9e69 (patch) | |
tree | 12e7cc9d9301642fc1e48332a0e0834c54e8c8af /redfish-core/lib/ethernet.hpp | |
parent | 52cc112d962920b035c870127784bcbd98948fad (diff) | |
download | bmcweb-23a21a1cbed23ace4174664950e595df961e9e69.tar.xz |
Enable clang warnings
This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:
Variable shadow issues were fixed by renaming variables
unused parameter warnings were resolved by either checking error codes
that had been ignored, or removing the name of the variable from the
scope.
Other various warnings were fixed in the best way I was able to come up
with.
Note, the redfish Node class is especially insidious, as it causes all
imlementers to have variables for parameters, regardless of whether or
not they are used. Deprecating the Node class is on my list of things
to do, as it adds extra overhead, and in general isn't a useful
abstraction. For now, I have simply fixed all the handlers.
Tested:
Added the current meta-clang meta layer into bblayers.conf, and added
TOOLCHAIN_pn-bmcweb = "clang" to my local.conf
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r-- | redfish-core/lib/ethernet.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp index a47d4b1052..852b3b72c4 100644 --- a/redfish-core/lib/ethernet.hpp +++ b/redfish-core/lib/ethernet.hpp @@ -669,9 +669,9 @@ inline bool ipv4VerifyIpAndGetBitcount(const std::string& ip, firstZeroInByteHit = false; // Count bits - for (int bitIdx = 7; bitIdx >= 0; bitIdx--) + for (long bitIdx = 7; bitIdx >= 0; bitIdx--) { - if (value & (1 << bitIdx)) + if (value & (1L << bitIdx)) { if (firstZeroInByteHit) { @@ -777,8 +777,8 @@ inline void deleteAndCreateIPv4(const std::string& ifaceId, messages::internalError(asyncResp->res); } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { - if (ec) + [asyncResp](const boost::system::error_code ec2) { + if (ec2) { messages::internalError(asyncResp->res); } @@ -843,8 +843,8 @@ inline void deleteAndCreateIPv6(const std::string& ifaceId, messages::internalError(asyncResp->res); } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { - if (ec) + [asyncResp](const boost::system::error_code ec2) { + if (ec2) { messages::internalError(asyncResp->res); } |