org.sonar.l10n.java.rules.squid.S1065.html Maven / Gradle / Ivy
If a label is declared but not used in the program, it can be considered as dead code and should therefore be removed.
This will improve maintainability as developers will not wonder what this label is used for.
Noncompliant Code Example
void foo() {
outer: //label is not used.
for(int i = 0; i<10; i++) {
break;
}
}
Compliant Solution
void foo() {
for(int i = 0; i<10; i++) {
break;
}
}
See
- MISRA C:2012, 2.6 - A function should not contain unused label declarations
© 2015 - 2025 Weber Informatics LLC | Privacy Policy