![]() |
![]() |
0943 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C99-6.8.6.1 The goto statement - Constraints | ||||||
This is a constraint error A goto statement that jumps to this label has been encountered earlier and the jump will enter the scope of an identifier with variably modified type. Jumping into into the scope of an identifier with variably modified type from outside the scope of that identifier is not permitted. For example:
/*PRQA S 1051,2001,2015,2017,2200,2201,2212,3120,3220,3227,3408 ++*/
void foo(int n)
{
if (n == 0)
goto lab1;
if (n < 100)
{
int a[n]; /* "a" has variably modified type */
a[0] = 1;
lab1: a[1] = 0; /* Message 0943 */
a[0] += n;
}
}
MISRA-C:2004 Rules applicable to message 0943:
| Rule 1.1 (Required) | All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192 |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |