Versions Compared

Key

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

...

If one or more of the operands to the multiplication operations used in many of these macro definitions can be influenced by untrusted data, these operands should be checked for overflow before invoking the macro (see INT32-C. Ensure that integer operations do not result in an overflow).

The use of type-generic function-like macros is an allowed exception (PRE00-EX4) to PRE00-A. Prefer inline or static functions to function-like macros.

Risk Assessment

Failing to cast the result of a memory allocation function call into a pointer to the allocated type can result in inadvertent pointer conversions. Code that follows this recommendation will compile and execute equally well in C++.

...