oclint规则 Unused(无用)

来源:互联网 发布:2017 淘宝 我的空间 编辑:程序博客网 时间:2024/06/05 05:58

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]")))
0 0
原创粉丝点击