Opened 4 years ago

Closed 4 years ago

#11195 closed enhancement (fixed)

FN: redundantContinue

Reported by: orbitcowboy Owned by: noone
Priority: Normal Milestone: 2.9
Component: Improve check Version:
Keywords: redundantContinue Cc:

Description

Unconditional jump statements typically has no effect.

#include <stdio.h>
void f(void)
{
    for (int i = 0; i < 10; ++i)
    {
        printf("i is %d", i);
        continue;  // this is meaningless; the loop would continue anyway
    }
}
$ g++ -c test.cpp && cppcheck --enable=all --inconclusive test.cpp 
Checking test.cpp ...
test.cpp:5:0: style: The function 'f' is never used. [unusedFunction]

^
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingIncludeSystem]


Change History (2)

comment:1 by orbitcowboy, 4 years ago

Keywords: redundantContinue added; constStatement removed
Milestone: 2.9
Summary: FN: constStatementFN: redundantContinue

comment:2 by orbitcowboy, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.