![]() |
|
MISRA-C:2004 Rule 16.2: (Required) |
|
||||
![]() | |||||||
Example Code:
#include "misra.h"
#include "m2cmex.h"
static void test_1602a( S16 x );
static void test_1602b( S16 x );
static void test_1602c( S16 x );
static void test_1602d( S16 x );
static void test_1602e( S16 x );
extern S16 test_1602( void )
{
test_1602a( 5 );
test_1602e( 5 );
return 1;
}
static void test_1602a( S16 x )
{
if ( x > 0 )
{
--x;
test_1602b( x );
}
}
static void test_1602b( S16 x )
{
if ( x > 0 )
{
--x;
test_1602c( x );
}
}
static void test_1602c( S16 x )
{
if ( x > 0 )
{
--x;
test_1602d( x );
}
}
static void test_1602d( S16 x )
{
if ( x > 0 )
{
--x;
test_1602a( x );
}
}
static void test_1602e( S16 x )
{
if ( x > 0 )
{
--x;
test_1602e( x ); /* MISRA Violation */
}
}
QAC messages that encompass this guideline:
| 1520 | Functions are indirectly recursive. |
| 3670 | Recursive call to function containing this call. |
|
||
(c) The Motor Industry Research Association, 2004
|
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2 © 2013 Programming Research www.programmingresearch.com |
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |