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

Full description
Uses of the goto statement were found. This check is identical to MISRAC2012-Rule-15.1, MISRAC++2023-9.6.1.
Coding standards
- MISRA C:2012 Rule-15.1
(Advisory) The goto statement should not be used
- MISRA C++ 2023 9.6.1
(Advisory) The goto statement should not be used
Code examples
The following code example fails the check and will give a warning:
int example(void) {
goto testin;
testin:
return 42; /* Reached by goto */
}
The following code example passes the check and will not give a warning about this issue:
int example(void) {
return 42; /* Not reached by goto" */
}