MISRA Discussion Forums

Full Version: Rule 8.6: External declaration without definition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a header file MISRA_8.6.h, in which a variable is declared:
Code:
extern signed short int Variable;

And I have the corresponding c-file MISRA_8.6.c, which uses the variable as input.
Code:
#include "MISRA_8.6.h"

signed short int A;

void main(void)
{

    /*8.6*/
    A = Variable;
    
}

The c-file defining the variable is out of scope. Is rule 8.6 violated by this setting or is another rule 8.x violated?
Rule 8.6 covers the situation when there is no external definition present in the set of files being analysed. Therefore "Variable" will violate rule 8.6.