OCLint

Unused

UnusedLocalVariable

Since: 0.4

Name: unused local variable

This rule detects local variables that are declared, but not used.

This rule is defined by the following class: 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

Name: unused method parameter

This rule detects parameters that are not used in the method.

This rule is defined by the following class: 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]")))