Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.4 - How are tentative definitions handled
#2
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)