MISRAC2004-20.2
In this section:
Synopsis
(Required) The names of standard library macros, objects and functions shall not be reused.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
One or more library functions are being overridden. This check is identical to MISRAC++2008-17-0-3, MISRAC2012-Rule-21.2, CERT-DCL37-C_a.
Coding standards
- CERT DCL37-C
Do not declare or define a reserved identifier
- MISRA C:2004 20.2
(Required) The names of Standard Library macros, objects, and functions shall not be reused.
- MISRA C:2012 Rule-21.2
(Required) A reserved identifier or macro name shall not be declared
- MISRA C++ 2008 17-0-3
(Required) The names of standard library functions shall not be overridden.
Code examples
The following code example fails the check and will give a warning:
void example(void) {}
extern "C" void strcpy(void);
void strcpy(void) {}
The following code example passes the check and will not give a warning about this issue:
void example(void) {}
extern "C" void bar(void);
void foo(void) {}