[previous] MISRA-C:2004  Rule  16.3:  (Required) [next] Identifiers shall be given for all of the parameters in a function prototype declaration.
Names shall be given for all the parameters in the function declaration for reasons of compatibility, clarity and maintainability.

Example Code:


/* PRQA S 2982 ++ */

#include "misra.h"
#include "m2cmex.h"

static S16 test_1603a( const S16 *x, const S16 *y );
static S16 test_1603b( const S16 *,  const S16 * );            /* MISRA Violation */
static S16 test_1603c( const S16 *u, const S16 * );            /* MISRA Violation */


extern S16 test_1603( void )
{
   S16 r;
   r = test_1603a( &s16a, &s16b );
   r = test_1603b( &s16a, &s16b );
   r = test_1603c( &s16a, &s16b );
   return r;
}

static S16 test_1603a( const S16 *x, const S16 *y )
{
   return *x + *y;
}

static S16 test_1603b( const S16 *a, const S16 *b )
{
   S16 (* test_1603p)(const S16 *, const S16 * );              /* MISRA Violation */
   S16 r;

   test_1603p = &test_1603a;
   r = test_1603p(a, b);

   return r;
}

static S16 test_1603c( const S16 *u, const S16 *v )
{
   return *u - *v;
}


QAC messages that encompass this guideline:

1335 Parameter identifiers missing in function prototype declaration.
1336 Parameter identifiers missing in declaration of a function type.



(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