Enable unused variable warnings and resolve
This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.
Tested:
Built with clang. Code no longer emits warnings.
Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.
Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/logging.h b/http/logging.h
index fcac94d..4498c3d 100644
--- a/http/logging.h
+++ b/http/logging.h
@@ -40,8 +40,9 @@
}
public:
- logger(const std::string& prefix, const std::string& filename,
- const size_t line, LogLevel levelIn) :
+ logger([[maybe_unused]] const std::string& prefix,
+ [[maybe_unused]] const std::string& filename,
+ [[maybe_unused]] const size_t line, LogLevel levelIn) :
level(levelIn)
{
#ifdef BMCWEB_ENABLE_LOGGING
@@ -63,7 +64,7 @@
//
template <typename T>
- logger& operator<<(T const& value)
+ logger& operator<<([[maybe_unused]] T const& value)
{
if (level >= get_current_log_level())
{