![]() |
![]() |
3312 | ![]() |
||||
![]() | |||||||
| Implicitly undefined | REFERENCE - ISO:C90-6.1.2.4 Storage Durations of Objects | ||||||
This goto statement will jump to a previous location in the code and will result in local objects being declared but uninitialized. For example, in the following code, the object 'j' appears to be initialized when it is defined, but the initialization will not actually take place if the goto statement is executed.
/*PRQA S 1-9999 ++*/
/*PRQA S 2752, 2962, 3311, 3312 --*/
extern int f1(int i, int n)
{
if (n > 0)
goto IN;
if (i)
{
int j = 2;
IN: n = j + 2; /* Message 3311 + 2962 */
goto OUT;
}
OUT: i = 2 + n;
return i;
}
extern int f2(int i, int n)
{
if (i)
{
int j = 2;
IN: n = j + 2;
goto OUT;
}
OUT: i = 2 + n;
if (n > 0)
goto IN; /* Message 3312 + 2752 */
return i;
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |