Why is this an issue?
In programming languages, keywords have a special meaning and are reserved for the language. Hence, it is a bad idea to define macros with keywords
as macro identifiers as it can easily lead to undefined behavior:
- The same object might be defined differently in different places, which violates the One Definition Rule
- If you include any header from the standard library, it is undefined behavior to define such macros
Additionally, it is awkward for anyone reading the code to have a keyword that means something different.
Noncompliant code example
#define int some_other_type // Noncompliant
External coding guidelines
- MISRA C:2012, 20.4 - A macro shall not be defined with the same name as a keyword