Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The documentation for unsafe macros must warn about putting side effects on the invocation, and the responsibility is on the programmer using the macro. Because of the risks associated with their use, it is recommended that you avoid the creation of unsafe macro functions. See also PRE00-A. Prefer inline or static functions to function-like macros.

Wiki Markup
The {{assert()}} macro is an excellent example of an unsafe macro. Its argument may be evaluated once or not at all, depending on the {{NDEBUG}} macro. For more information, see \[EXP39-C. Avoid side effects in assertions}.

Non-Compliant Coding Example

...

Wiki Markup
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 5.1.2.3, "Program execution"
\[[MISRA 04|AA. C References#MISRA 04]\] Rule 19.6
\[[Plum 85|AA. C References#Plum 85]\] Rule 1-11

...