[previous] 2051 [next] The 'int' type specifier has been omitted from an object declaration.
Declarations and Definitions

The type of an object has not been explicitly defined and is therefore implicitly defined as int. This is permitted in ISO:C90 but is not allowed in ISO:C99.

For example:


/*PRQA S 506,2017,3210,3227,3408,3447,3602 ++*/

extern foo1(void);                      /* Message 2050 */

extern const va;                        /* Message 2051 */

extern int foo2(const * p)
{                                       /* Message 2051 */
    return *p;
}

extern foo3(void)
{                                       /* Message 2050 */
    const x = 10;                       /* Message 2051 */
    return x;
}


MISRA-C:2004 Rules applicable to message 2051:

Rule  8.2  (Required) Whenever an object or function is declared or defined, its type shall be explicitly stated.


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