V2505. MISRA. The 'goto' statement shouldn't jump to a label declared earlier.

This diagnostic rule is based on the software development guidelines developed by MISRA (Motor Industry Software Reliability Association).

The use of a 'goto' statement that jumps to a previously declared label obscures the code and, therefore, makes it harder to maintain.

Here is an example of code that will trigger this warning:

void init(....)
  if (....)
    if (....)
      goto again;

To eliminate the warning, delete the 'goto' statement or rewrite the code so that the 'goto' statement is followed, rather than preceded, by the label it refers to.

This diagnostic is classified as:

  • MISRA-C-15.2
  • MISRA-CPP-6.6.2

Bugs Found

Checked Projects
Collected Errors
14 526
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →