From 717f285c644eb4eb6b69898a223ad4453c0971c4 Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Mon, 17 Jun 2019 13:08:06 -0500 Subject: [PATCH] Supress implicit-fallthrough warnings. In some parts of the mtce code some implicit fallthrough are used. This causes a warning in the compiler and in OSes like openSUSE the -Werror flag is enforced leading to a build error. In this commit the __attribute__ ((fallthrough)) is used to tell the compiler to not worry about this implicit fallthroughs as the it works as intended. Change-Id: I219ff9d490f3f86ad045e0f0e891f40467baaf06 Story: 2005862 Task: 33667 Signed-off-by: Erich Cordoba --- mtce/src/common/nodeClass.cpp | 2 ++ mtce/src/maintenance/mtcNodeHdlrs.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/mtce/src/common/nodeClass.cpp b/mtce/src/common/nodeClass.cpp index 8dbb755a..a174c466 100755 --- a/mtce/src/common/nodeClass.cpp +++ b/mtce/src/common/nodeClass.cpp @@ -826,6 +826,7 @@ struct nodeLinkClass::node* nodeLinkClass::getEventBaseNode ( libEvent_enum requ return ptr ; } + __attribute__ ((fallthrough)); } case VIM_HOST_DISABLED: case VIM_HOST_ENABLED: @@ -839,6 +840,7 @@ struct nodeLinkClass::node* nodeLinkClass::getEventBaseNode ( libEvent_enum requ return ptr ; } + __attribute__ ((fallthrough)); } case BARBICAN_GET_SECRET: case BARBICAN_READ_SECRET: diff --git a/mtce/src/maintenance/mtcNodeHdlrs.cpp b/mtce/src/maintenance/mtcNodeHdlrs.cpp index 6aa14f42..f3318880 100755 --- a/mtce/src/maintenance/mtcNodeHdlrs.cpp +++ b/mtce/src/maintenance/mtcNodeHdlrs.cpp @@ -3232,6 +3232,7 @@ int nodeLinkClass::offline_handler ( struct nodeLinkClass::node * node_ptr ) node_ptr->offlineStage = MTC_OFFLINE__SEND_MTCALIVE ; /* fall through on start */ + __attribute__ ((fallthrough)); } case MTC_OFFLINE__SEND_MTCALIVE: { @@ -3870,6 +3871,7 @@ int nodeLinkClass::reset_handler ( struct nodeLinkClass::node * node_ptr ) } node_ptr->power_action_retries = MTC_RESET_ACTION_RETRY_COUNT ; /* the fall through is intentional */ + __attribute__ ((fallthrough)); } case MTC_RESET__REQ_SEND: { @@ -4692,6 +4694,7 @@ int nodeLinkClass::power_handler ( struct nodeLinkClass::node * node_ptr ) node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ; //the fall through to MTC_POWEROFF__REQ_SEND is intentional + __attribute__ ((fallthrough)); } case MTC_POWEROFF__REQ_SEND: { @@ -4851,6 +4854,7 @@ int nodeLinkClass::power_handler ( struct nodeLinkClass::node * node_ptr ) node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ; powerStageChange ( node_ptr , MTC_POWERON__POWER_STATUS ); //the fall through to MTC_POWERON__REQ_SEND is intentional + __attribute__ ((fallthrough)); } case MTC_POWERON__POWER_STATUS: {