[C-safe-secure-studygroup] On MISRA C:2012 Rule 8.6

Roberto Bagnara bagnara at cs.unipr.it
Wed Jun 28 06:16:30 UTC 2017


MISRA C:2012 Rule 8.6:
An identifier with external linkage shall have exactly one external definition

In C11, the following is undefined behavior (see J.2):

- An identifier with external linkage is used, but in the program
  there does not exist exactly one external definition for the
  identifier, or the identifier is not used and there exist multiple
  external definitions for the identifier (6.9).

Unless one enforces a discipline whereby all external identifiers
must be declared in header files that must be included by all the
TU that mentions them, it is quite easy to fall into this trap
(and most linkers offer no protection against this kind of mistake).

I thus propose this rule is included, verbatim, in both profiles.

-- 
     Prof. Roberto Bagnara

Applied Formal Methods Laboratory - University of Parma, Italy
mailto:bagnara at cs.unipr.it
                              BUGSENG srl - http://bugseng.com
                              mailto:roberto.bagnara at bugseng.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2093 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.trustable.io/pipermail/c-safe-secure-studygroup/attachments/20170628/31e8d262/attachment.bin>


More information about the C-safe-secure-studygroup mailing list