Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.5: Declarations vs Redeclarations in MISRA C versus MISRA C++
#2
The intent of the MISRA-C and MISRA-C++ rules is the same in this area, however C and C++ use different terminology.
C does not use the term "re-declaration" and "declarations" refers both the first and subsequent declarations.

The following is a C example where it is dangerous to have multiple declarations.
Code:
File 1:
    int n;
File 2
    extern long n;
The linker may fail to notice the type mismatch.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)