MISRA Discussion Forums
MISRA C 2012 rule 8.6 - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: General Questions (https://forum.misra.org.uk/forumdisplay.php?fid=27)
+--- Thread: MISRA C 2012 rule 8.6 (/showthread.php?tid=1215)



MISRA C 2012 rule 8.6 - mcorles5 - 18-11-2015

The rule definition is "An identifier with external linkage shall have exactly one external definition." When I look at where it says there are multiple definitions, it points to the same line.
Ie.
global variable 'CALIBRATION_MISMATCH' has multiple tentatives of definitions (C:\User\Desktop\globals.c:137, C:\Users\Desktop\globals.c:137) (Required)
U8 CALIBRATION_MISMATCH;


Re: MISRA C 2012 rule 8.6 - misra-c - 11-12-2015

Given the limited information provided, it is not possible to give a definitive answer.

This answer assumes that there are no other declarations or definitions of CALIBRATION_MISMATCH in the translation unit. "U8 CALIBRATION_MISMATCH;" is then a tentative definition which becomes an external definition at the end of the translation unit.

This is compliant with rule 8.6 if there are no other definitions of CALIBRATION_MISMATCH in any other translation unit in the system. Note that including "globals.c" as a header file in another translation unit would mean that there was more than one definition in the system.

The MISRA-C working group can make no comments on messages from a particular tool. You should raise the issue with your tool vendor.