如何解决此语句可能会落入[-Werror = implicit-fallthrough =]? [英] How to fix this statement may fall through [-Werror=implicit-fallthrough=]?
本文介绍了如何解决此语句可能会落入[-Werror = implicit-fallthrough =]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
做什么
this statement may fall through [-Werror=implicit-fallthrough=]
平均值?
我在编译如下语句时遇到此错误:
I getting this error while compiling at statement like this:
switch(eT)
{
case SEL_CRIT:
{
TYPE1* psSel;
iRetVal = dbseq(enB->m_ps,
NULL, NULL, &esM, NULL, ESEC);
while (iRetVal == 0)
{
if(psEnterprise)
{
bool iFound = false;
for (i = 0; i< psME->m_pslave[0].m_uc; i++)
{
ENT node1;
sEOS = psME>m_pslave[0].m_pslavecnt[i];
}
if (iFound && (psME->m_NOTOVERLOADED == false))
{
return psME;
}
}
}
psSel = (M_EN*)pCrit;
LOG_INFO(FAIL_TO_LOAD, psME->m_ONG, psME->EN);
int_Enterprise = NULL;
}
在
int_Enterprise = NULL;
其中
int_Enterprise是某种结构指针。
int_Enterprise is some structure pointer.
我该如何解决?
推荐答案
您没有 break;
在您的案例结尾:
,因此执行将落入下一个案例
。如果要添加 break
语句以防止掉线,或者添加 [[fallthrough]]
属性倒塌是有意的。
You have no break;
at the end of your case:
so execution will fall through into the next case
. Add a break
statement to prevent fall-through if that's what you want or add a [[fallthrough]]
attribute if fallthrough is intended.
这篇关于如何解决此语句可能会落入[-Werror = implicit-fallthrough =]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文