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 MTCE_FALLTHROUGH macro is used to tell the compiler to not worry about this implicit fallthroughs as the it works as intended. Change-Id: I608d80eaa7298d0613ffa62ee82e03463d193d87 Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
parent
c8603da349
commit
7af0a828c1
|
@ -828,6 +828,7 @@ struct nodeLinkClass::node* nodeLinkClass::getEventBaseNode ( libEvent_enum requ
|
||||||
|
|
||||||
return ptr ;
|
return ptr ;
|
||||||
}
|
}
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case VIM_HOST_DISABLED:
|
case VIM_HOST_DISABLED:
|
||||||
case VIM_HOST_ENABLED:
|
case VIM_HOST_ENABLED:
|
||||||
|
@ -841,6 +842,7 @@ struct nodeLinkClass::node* nodeLinkClass::getEventBaseNode ( libEvent_enum requ
|
||||||
|
|
||||||
return ptr ;
|
return ptr ;
|
||||||
}
|
}
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case BARBICAN_GET_SECRET:
|
case BARBICAN_GET_SECRET:
|
||||||
case BARBICAN_READ_SECRET:
|
case BARBICAN_READ_SECRET:
|
||||||
|
|
|
@ -25,6 +25,12 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||||
|
#define MTCE_FALLTHROUGH __attribute__ ((fallthrough));
|
||||||
|
#else
|
||||||
|
#define MTCE_FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Include base class definition header */
|
/* Include base class definition header */
|
||||||
#include "nodeBase.h"
|
#include "nodeBase.h"
|
||||||
#include "hostUtil.h" /* for ... server_code and others */
|
#include "hostUtil.h" /* for ... server_code and others */
|
||||||
|
|
|
@ -3230,6 +3230,7 @@ int nodeLinkClass::offline_handler ( struct nodeLinkClass::node * node_ptr )
|
||||||
|
|
||||||
node_ptr->offlineStage = MTC_OFFLINE__SEND_MTCALIVE ;
|
node_ptr->offlineStage = MTC_OFFLINE__SEND_MTCALIVE ;
|
||||||
/* fall through on start */
|
/* fall through on start */
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case MTC_OFFLINE__SEND_MTCALIVE:
|
case MTC_OFFLINE__SEND_MTCALIVE:
|
||||||
{
|
{
|
||||||
|
@ -3869,6 +3870,7 @@ int nodeLinkClass::reset_handler ( struct nodeLinkClass::node * node_ptr )
|
||||||
}
|
}
|
||||||
node_ptr->power_action_retries = MTC_RESET_ACTION_RETRY_COUNT ;
|
node_ptr->power_action_retries = MTC_RESET_ACTION_RETRY_COUNT ;
|
||||||
/* the fall through is intentional */
|
/* the fall through is intentional */
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case MTC_RESET__REQ_SEND:
|
case MTC_RESET__REQ_SEND:
|
||||||
{
|
{
|
||||||
|
@ -4691,6 +4693,7 @@ int nodeLinkClass::power_handler ( struct nodeLinkClass::node * node_ptr )
|
||||||
|
|
||||||
node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ;
|
node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ;
|
||||||
//the fall through to MTC_POWEROFF__REQ_SEND is intentional
|
//the fall through to MTC_POWEROFF__REQ_SEND is intentional
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case MTC_POWEROFF__REQ_SEND:
|
case MTC_POWEROFF__REQ_SEND:
|
||||||
{
|
{
|
||||||
|
@ -4850,6 +4853,7 @@ int nodeLinkClass::power_handler ( struct nodeLinkClass::node * node_ptr )
|
||||||
node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ;
|
node_ptr->power_action_retries = MTC_POWER_ACTION_RETRY_COUNT ;
|
||||||
powerStageChange ( node_ptr , MTC_POWERON__POWER_STATUS );
|
powerStageChange ( node_ptr , MTC_POWERON__POWER_STATUS );
|
||||||
//the fall through to MTC_POWERON__REQ_SEND is intentional
|
//the fall through to MTC_POWERON__REQ_SEND is intentional
|
||||||
|
MTCE_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
case MTC_POWERON__POWER_STATUS:
|
case MTC_POWERON__POWER_STATUS:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue