[previous] 2883 [next] This 'goto' statement will always bypass the initialization of local variables.
Control flow

This goto statement will bypass the initialization of one or more local variables. Any attempt to use the value of one of these variables will result in undefined behaviour.


/*PRQA S 1313,2001,2015,2017,2200,2201,3201,3205,3220,3311,3408 ++*/
void foo(int n)
{
   goto LAB;                        /* 2883 */

   {
       int c = 0;

LAB:   ++n;                         /*      */
   }
}


MISRA C:2012 Rules applicable to message 2883:

Rule-9.1  (Mandatory) The value of an object with automatic storage duration shall not be read before it has been set


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents