[previous] 0627 [next] [C] '%s' has different type to previous declaration in the same scope.
Constraint violations REFERENCE - ISO:C90-6.5 Declarations - Constraints

This is a constraint error

Two declarations of the same identifier in the same scope are in conflict. Note that it is possible and legitimate (although unwise) to hide an identifier with a different declaration at an inner scope.

For example:


/*PRQA S 2211,2213,3205,3408,3447,3602 ++*/

enum ET {A, B, C};
typedef short A;                /* Message 0627 and also 0631 */

extern int f2(void);

void foo(void)
{
    typedef int figure;
    long        figure;         /* Message 0627 and also 0631 */
}

void f2(void)                   /* Message 0627 */
{
}


MISRA-C:2004 Rules applicable to message 0627:

Rule  1.1  (Required) All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192
Rule  8.4  (Required) If objects or functions are declared more than once their types shall be compatible.


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