MISRA Discussion Forums
Clarification of rule 2.3 and 2.4 - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 8.1 A standard C environment (https://forum.misra.org.uk/forumdisplay.php?fid=156)
+---- Thread: Clarification of rule 2.3 and 2.4 (/showthread.php?tid=1166)



Clarification of rule 2.3 and 2.4 - anuj1085 - 13-03-2015

The rules deals with unused tag and unused type declaration.

My query is whether the unused tag and unused types declared in "header" file are also violation of this rule. Example below to explain more:

content of test.h:

int16_t unusedtype (void)
{
typedef int16_t local_type;
return 67;
}

This header is included in test.c. Should the violations be reported on this.


Re: Clarification of rule 2.3 and 2.4 - misra-c - 27-03-2015

The "local_type" declaration will still violate rule 2.3 if it is declared in a header file.