Proper handling for unused parameters
Instead of ignoring the parameter warning via a compile flag we can
explicitly not give the parameter a valiable name. The compile will then
know that that the parameter is not expected to be used.
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Idfc9c7b2ac9e2f6a3d220540a354b1b8e890bee8
diff --git a/analyzer/hei_user_interface.cpp b/analyzer/hei_user_interface.cpp
index 2422b38..277ac9f 100644
--- a/analyzer/hei_user_interface.cpp
+++ b/analyzer/hei_user_interface.cpp
@@ -65,8 +65,7 @@
//------------------------------------------------------------------------------
-bool __readOcmb(pdbg_target* i_obmcTrgt, RegisterType_t i_regType,
- uint64_t i_address, uint64_t& o_value)
+bool __readOcmb(pdbg_target*, RegisterType_t, uint64_t, uint64_t&)
{
bool accessFailure = false;
diff --git a/attn/attn_handler.cpp b/attn/attn_handler.cpp
index 8a5042d..caf5265 100644
--- a/attn/attn_handler.cpp
+++ b/attn/attn_handler.cpp
@@ -363,14 +363,15 @@
*/
bool activeAttn(uint32_t i_val, uint32_t i_mask, uint32_t i_attn)
{
- bool rc = false; // assume attn masked and/or inactive
- bool validAttn = true; // known attention type
+ bool rc = false; // assume attn masked and/or inactive
// if attention active
if (0 != (i_val & i_attn))
{
std::stringstream ss;
+ bool validAttn = true; // known attention type
+
switch (i_attn)
{
case SBE_ATTN:
diff --git a/attn/attn_logging.cpp b/attn/attn_logging.cpp
index a55ac55..48ee5be 100644
--- a/attn/attn_logging.cpp
+++ b/attn/attn_logging.cpp
@@ -476,16 +476,6 @@
}
}
-/** @brief Commit checkstop event to log */
-void eventCheckstop(std::map<std::string, std::string>& i_errors)
-{
- // Additional data for log
- std::map<std::string, std::string> additionalData;
-
- // Create log event with additional data and FFDC data
- event(EventType::Checkstop, additionalData, createFFDCFiles(nullptr, 0));
-}
-
/**
* Commit special attention TI event to log
*
@@ -514,23 +504,6 @@
}
/**
- * Commit analyzer failure event to log
- *
- * Create an event log containing the specified error code.
- *
- * @param i_error - Error code
- */
-void eventHwDiagsFail(int i_error)
-{
- // Additiona data for log
- std::map<std::string, std::string> additionalData;
- additionalData["ERROR_CODE"] = std::to_string(i_error);
-
- // Create log event with additional data and FFDC data
- event(EventType::HwDiagsFail, additionalData, createFFDCFiles(nullptr, 0));
-}
-
-/**
* Commit attention handler failure event to log
*
* Create an event log containing the specified error code.
@@ -562,11 +535,12 @@
{
const char* data{nullptr};
size_t length{0};
- size_t prefix{0};
// get field value
if (0 == sd_journal_get_data(journal, field, (const void**)&data, &length))
{
+ size_t prefix{0};
+
// The data returned by sd_journal_get_data will be prefixed with the
// field name and "="
const void* eq = memchr(data, '=', length);
diff --git a/attn/attn_logging.hpp b/attn/attn_logging.hpp
index 0103a52..edbc143 100644
--- a/attn/attn_logging.hpp
+++ b/attn/attn_logging.hpp
@@ -33,9 +33,6 @@
template <level L>
void trace(const char* i_message);
-/** @brief Commit checkstop event to log */
-void eventCheckstop(std::map<std::string, std::string>& i_errors);
-
/** @brief Commit special attention TI event to log */
void eventTerminate(std::map<std::string, std::string> i_additionalData,
char* i_tiInfoData);
@@ -43,9 +40,6 @@
/** @brief Commit SBE vital event to log */
void eventVital();
-/** @brief Commit analyzer failure event to log */
-void eventHwDiagsFail(int i_error);
-
/** @brief Commit attention handler failure event to log */
void eventAttentionFail(int i_error);
diff --git a/meson.build b/meson.build
index 64cf993..0bde487 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,6 @@
'warning_level=3',
'werror=true',
'cpp_std=c++17',
- 'cpp_args=-Wno-unused-parameter'
])
#-------------------------------------------------------------------------------
diff --git a/test/end2end/logging.cpp b/test/end2end/logging.cpp
index a03ad4c..7574888 100644
--- a/test/end2end/logging.cpp
+++ b/test/end2end/logging.cpp
@@ -12,20 +12,6 @@
std::cout << "trace: " << i_message << std::endl;
}
-void eventCheckstop(std::map<std::string, std::string>& i_errors)
-{
- std::string signature = i_errors.begin()->first;
- std::string chip = i_errors.begin()->second;
-
- std::cout << "event: checkstop, signature = " << signature
- << ", chip = " << chip << std::endl;
-}
-
-void eventHwDiagsFail(int i_error)
-{
- std::cout << "event: hwdiags fail " << i_error << std::endl;
-}
-
void eventAttentionFail(int i_error)
{
std::cout << "event: attention fail" << i_error << std::endl;