Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.5: Declarations vs Redeclarations in MISRA C versus MISRA C++
#3
Thank you for your response, however, it appears that there has been a slight misunderstanding on what I was requesting.

MISRA C++ defines 'declaration' as the first introduction of a name in a translation unit and all subsequent 'declarations' in that translation unit are 'redeclarations'. Both MISRA versions catch the example of declarations in different translation units and I understand why that is a problem.

However, MISRA C goes further than MISRA C++, as at least my reading of the wording results in non-defining re-declarations as also being non-compliant:
Code:
/* file.h */
  extern int i;
  extern int i; // non-compliant

In my opinion, this is unnecessarily restrictive, hence, I am requesting an example that shows why multiple non-defining (re)declarations in the same translation unit should be avoided.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)