Rule Definition
It is generally a bad practice to #undef a macro that is defined in the standard library. It is also bad practice to #define a macro name that is a C++ reserved identifier, or C++ keyword or the name of any macro, object or function in the standard library. For example, there are some specific reserved words and function names that are known to give rise to undefined behavior if they are redefined or undefined, including defined, __LINE__, __FILE__, __DATE__, __TIME__,__STDC__, errno and assert.
Remediation
Do not define, undefine the standard macros
Violation Code Sample
#define __TIME__ 11111111 // Non-compliant
Reference
MISRA C++, Rule 17–0–1: Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined.
Related Technologies
Technical Criterion
Programming Practices - Unexpected Behavior
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.