19-09-2018, 06:04 AM
Hi,
MISRA C-2012 Rule 5.3 (which is of the same title as 2-10-2) has this additional amplification about an identifier declared in an inner scope shall be distinct from *any* id declared in an outer scope.
So the following code shall be a violation for 5.3 although the inner "i" is not hiding the outer "i" (still confusing though).
Since 2-10-2 does not have this amplification, could you kindly help to advise whether this is also a violation for 2-10-2 or not?
MISRA C-2012 Rule 5.3 (which is of the same title as 2-10-2) has this additional amplification about an identifier declared in an inner scope shall be distinct from *any* id declared in an outer scope.
So the following code shall be a violation for 5.3 although the inner "i" is not hiding the outer "i" (still confusing though).
Code:
void f() {
{
int i; // Non-compliant
}
int i;
}
Since 2-10-2 does not have this amplification, could you kindly help to advise whether this is also a violation for 2-10-2 or not?
<t></t>