All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S1065.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

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