rspec/rules/S5266/rule.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

21 lines
735 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

In programming languages keywords have a special meaning and are reserved to the language. It is hence a bad idea to define macros with keywords as macro identifier 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 very awkward for anyone reading the code to have a keyword that means something different.
== Noncompliant Code Example
----
#define int some_other_type // Noncompliant
#include <stdlib.h>;
----
== See
* MISRA C:2012, 20.4 - A macro shall not be defined with the same name as a keyword