19-12-2013, 08:31 AM
This will depend on the presence of other definitions as to whether the Tentative definition is treated as a declaration or a definition.
Code:
extern int32_t ext_val0 = 3; // Non-compliant - definition and no declaration
int32_t ext_val1 = 3; // Non-compliant - definition and no declaration
extern int32_t extval2; // Compliant - declaration
int32_t extval2 = 3; // followed by compatible definition
int32_t ext_val3; // Compliant - Tentative definition, but treated as declaration
int32_t ext_val3 = 3; // because followed by compatible definition
int32_t ext_val4; // Non-compliant - Tentative definition,
// which becomes a definition, initialising ext_val4 to 0.
Posted by and on behalf of the MISRA C Working Group