oclint规则 Unused(无用)

Unused

无用本地变量 UnusedLocalVariable

Since: 0.4

检查声明了,却没有使用的本地变量.

定义类: oclint-rules/rules/unused/UnusedLocalVariableRule.cpp

Example:

int example(int a)
{
    int i;          // variable i is declared, but not used
    return 0;
}

Suppress:

__attribute__((annotate("oclint:suppress[unused local variable]")))

无用的方法参数 UnusedMethodParameter

Since: 0.4

检查无用方法参数.

定义类: oclint-rules/rules/unused/UnusedMethodParameterRule.cpp

Example:

int example(int a)  // parameter a is not used
{
    return 0;
}

Suppress:

__attribute__((annotate("oclint:suppress[unused method parameter]")))
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章