MISRAC2004-14.5
In this section:
Synopsis
(Required) The continue statement shall not be used.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Uses of the continue statement were found.
Coding standards
- MISRA C:2004 14.5
(Required) The continue statement shall not be used.
Code examples
The following code example fails the check and will give a warning:
#include <stdio.h>
// Print the odd numbers between 0 and 99
void example(void) {
int i;
for (i = 0; i < 100; i++) {
if (i % 2 == 0) {
continue;
}
printf("%d", i);
}
}
The following code example passes the check and will not give a warning about this issue:
#include <stdio.h>
// Print the odd numbers between 0 and 99
void example(void) {
int i;
for (i = 0; i < 100; i++) {
if (i % 2 != 0) {
printf("%d", i);
}
}
}