Fix some warnings
1. Enabled Meson options to treat warnings as errors.
2. Removed unused variable in vpd_tool_impl.cpp.
3. Fix for unused variable warning in vpdecc & vpd manager files.
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I59fab47fe394b2934d6050d9db78c68b7e471503
diff --git a/meson.build b/meson.build
index 7cb1e69..aa68922 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,9 @@
'c',
'cpp',
default_options: [
- 'cpp_std=c++17'
+ 'warning_level=3',
+ 'werror=true',
+ 'cpp_std=c++17'
],
version: '1.0'
)
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 9eeb6e2..606d3b5 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -19,7 +19,7 @@
namespace manager
{
Manager::Manager(sdbusplus::bus::bus&& bus, const char* busName,
- const char* objPath, const char* iFace) :
+ const char* objPath, const char* /*iFace*/) :
ServerObject<ManagerIface>(bus, objPath),
_bus(std::move(bus)), _manager(_bus, objPath)
{
diff --git a/vpd-manager/manager_main.cpp b/vpd-manager/manager_main.cpp
index 459c9f4..fce02b4 100644
--- a/vpd-manager/manager_main.cpp
+++ b/vpd-manager/manager_main.cpp
@@ -7,7 +7,7 @@
#include <iostream>
#include <sdbusplus/bus.hpp>
-int main(int argc, char* argv[])
+int main(int /*argc*/, char** /*argv*/)
{
try
{
diff --git a/vpd_tool_impl.cpp b/vpd_tool_impl.cpp
index c24eb93..1ee7b2b 100644
--- a/vpd_tool_impl.cpp
+++ b/vpd_tool_impl.cpp
@@ -172,7 +172,6 @@
throw runtime_error("Extra Interfaces not found");
}
- bool exIntfCheck = false;
json output = json::object({});
fruType = "FRU";
@@ -195,7 +194,6 @@
{
if (!(ex.value().is_null()))
{
- exIntfCheck = true;
getExtraInterfaceProperties(itemEEPROM.at("inventoryPath"),
ex.key(), ex.value(),
itemEEPROM["extraInterfaces"], js);
diff --git a/vpdecc/vpdecc.h b/vpdecc/vpdecc.h
index 6e7605f..6d4175d 100644
--- a/vpdecc/vpdecc.h
+++ b/vpdecc/vpdecc.h
@@ -17,6 +17,9 @@
#ifndef _VPDECC_H_
#define _VPDECC_H_
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+
#include <stdlib.h>
#define VPD_ECC_OK 0