AutosarC++17_10-M3.9.1¶
The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
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.
Example
typedef int32_t INT;
INT i;
extern int32_t i; // Non-compliant
INT j;
extern INT j; // Compliant
// The following lines break Rule 3.9.2
extern void f ( signed int );
void f ( int ); // Non-compliant
extern void g ( const int );
void g ( int ); // Non-compliant
See also
Rule 3.2.1, Rule 3.9.2
Note
For legal reasons, this rule’s description is not part of the public documentation.