How do I turn off a static code analysis warning on a line by line warning in CDT (C code)?

后端 未结 7 1172
一向
一向 2021-01-17 13:19

We have a project using CDT in Eclipse. It\'s an old project that we just imported into Eclipse, and I want to ensure we start using static code analysis to find any weirdn

7条回答
  •  死守一世寂寞
    2021-01-17 13:54

    As is has been said, in this specific case, it can be solved adding the comment:

    //no break
    

    or:

    //no break at the end of case
    

    What really matters is the (no break).

    But also, it is required that you don't have more comments between the end of this case and the next one or it won't work. For example the next case will still result in a warning:

    case enChC:
        ++nChannel;
        //No break
        //This second case decrease the value
      case enChD:
        ++nChannel;
    

提交回复
热议问题