Chapter 2. Preprocessor (PRE)

Recommendations and Rules

images

Risk Assessment Summary

images

Related Rules and Recommendations

images

PRE00-C. Prefer inline or static functions to function-like macros

Macros are dangerous because their use resembles that of real functions, but they have different semantics. C99 adds inline functions to the C programming language. Inline functions should be preferred over macros when they can be used interchangeably. Making a function ...

Get The CERT® C Secure Coding Standard now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.