Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 5.6 A ty pedef name shall be a unique identifier
#3
Each of the MISRA C:2012 rules has an analysis scope which applies to them. This is described in section 6.6 of the document.

Rule 5.3 has the analysis scope of "Single Translation Unit". This means that each .c file and its associated header files are looked at on their own. When looking a file "d.c", the file "c.c" is not considered and therefore there is no violation of rule 5.3. However, it is a violation of rule 5.8 which requires objects with external linkage to be unique across the "System" of files.

Rule 5.6 has the analysis scope of "System", which means that files "a.c" and "b.c" should be considered together. The example will violate rule 5.6.
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)