34 lines
505 B
Plaintext
34 lines
505 B
Plaintext
![]() |
If a re-declaration has compatible types but not types which are token-for-token identical, it may not be clear to which declaration that re-declaration refers.
|
||
|
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
typedef int32_t INT;
|
||
|
|
||
|
INT i;
|
||
|
extern int32_t i; // Noncompliant
|
||
|
|
||
|
extern void f ( INT );
|
||
|
void f ( int32_t ); // Noncompliant
|
||
|
----
|
||
|
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
typedef int32_t INT;
|
||
|
|
||
|
INT i;
|
||
|
extern INT i; // Compliant
|
||
|
|
||
|
extern void f ( INT );
|
||
|
void f ( INT ); // Compliant
|
||
|
----
|
||
|
|
||
|
|
||
|
== See
|
||
|
|
||
|
* MISRA C++:2008, 3-9-1
|
||
|
|