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 , 4 years ago
| Keywords: | redundantContinue added; constStatement removed |
|---|---|
| Milestone: | → 2.9 |
| Summary: | FN: constStatement → FN: redundantContinue |
comment:2 by , 4 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Fixed with https://github.com/danmar/cppcheck/commit/109a031ec7d8c79ea2e2261e433e8e89125ccbb7