Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question for a example of Rule8.6
#1
I have a question for the Rule8.6 exmaple.

Your guideline has a following example.
/* file3.c */
int16_t j; /* Tentative definition */
int16_t j=1; /* Compliant - external definition */

I make the next exapmle.
Is it correct?

/* file3_2.c */
int16_t m=1; /* Compliant - external definition */ ←is it correct?
int16_t m; /* declaration */ ←is it correct?


Best Regards,
Kumiko Itoh
<t></t>
#2
You are correct. The example on "m" is compliant. Technically "int16_t m;" is a tentative definition that refers to the previous external definition. It is similar to the example "i1" in Example of section 6.9.2 of the C99 standard.
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 2 Guest(s)