Skip to main content
assistive.skiplink.to.breadcrumbs
assistive.skiplink.to.header.menu
assistive.skiplink.to.action.menu
assistive.skiplink.to.quick.search
Log in
Confluence
Spaces
Hit enter to search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Confluence
Log in
SEI CERT C Coding Standard
Pages
Boards
Space shortcuts
Dashboard
Secure Coding Home
Android
C
C++
Java
Perl
Page tree
Browse pages
Configure
Space tools
View Page
A
t
tachments (0)
Page History
Page Information
View in Hierarchy
View Source
Export to PDF
Export to Word
Pages
…
SEI CERT C Coding Standard
3 Recommendations
Rec. 01. Preprocessor (PRE)
PRE00-C. Prefer inline or static functions to function-like macros
Page Information
Title:
PRE00-C. Prefer inline or static functions to function-like macros
Author:
Robert Seacord
May 03, 2008
Last Changed by:
Joerg Herter
Oct 29, 2025
Tiny Link:
(useful for email)
https://wiki.sei.cmu.edu/confluence/x/INcxBQ
Export As:
Word
·
PDF
Incoming Links
SEI CERT C Coding Standard (7)
Page:
PRE01-C. Use parentheses within macros around parameter names
Page:
PRE02-C. Macro replacement lists should be parenthesized
Page:
PRE10-C. Wrap multistatement macros in a do-while loop
Page:
PRE11-C. Do not conclude macro definitions with a semicolon
Page:
PRE12-C. Do not define unsafe macros
Page:
MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
Page:
PRE31-C. Avoid side effects in arguments to unsafe macros
Hierarchy
Parent Page
Page:
Rec. 01. Preprocessor (PRE)
Labels
Global Labels (6)
ldra
rose-na-macros
android-applicable
exceptions
recommendation
pre
Recent Changes
Time
Editor
Oct 29, 2025 04:27
Joerg Herter
View Changes
May 19, 2025 14:57
David Svoboda
View Changes
May 19, 2025 14:55
Swasti Shrivastava
View Changes
REM Cost Reform
Dec 12, 2024 06:30
Swasti Shrivastava
View Changes
May 15, 2023 08:46
Alexander Wagner
View Page History
Outgoing Links
External Links (7)
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/display/c/Polyspace+Bug…
https://www.mathworks.com/help/bugfinder/ref/certcrec.pre00…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
gcc.gnu.org/onlinedocs/gcc/Inline.html
https://www.kb.cert.org/vulnotes/bymetric?searchview&query=…
https://www.sonarsource.com/products/codeanalyzers/sonarcfa…
SEI CERT C Coding Standard (33)
Page:
ECLAIR
Page:
LDRA_V
Page:
PRE01-C. Use parentheses within macros around parameter names
Page:
BB. Definitions
Page:
Helix QAC_V
Page:
MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
Page:
CodeSonar
Page:
RuleChecker
Page:
AA. Bibliography
Page:
Polyspace Bug Finder_V
Page:
Axivion Bauhaus Suite_V
Page:
PC-lint Plus_V
Page:
Helix QAC
Page:
PRE05-C. Understand macro replacement when concatenating tokens or performing stringification
Home page:
SEI CERT C Coding Standard
Page:
Axivion Bauhaus Suite
Page:
Astrée_V
Page:
PRE02-C. Macro replacement lists should be parenthesized
Page:
Cppcheck Premium_V
Page:
EXP30-C. Do not depend on the order of evaluation for side effects
Page:
LDRA
Page:
DCL01-C. Do not reuse variable names in subscopes
Page:
Klocwork_V
Page:
Parasoft_V
Page:
Parasoft
Page:
ECLAIR_V
Page:
Klocwork
Page:
RuleChecker_V
Page:
PC-lint Plus
Page:
Cppcheck Premium
Page:
PRE31-C. Avoid side effects in arguments to unsafe macros
Page:
Astrée
Page:
CodeSonar_V
SEI CERT C++ Coding Standard (2)
Page:
VOID PRE00-CPP. Avoid defining macros
Home page:
SEI CERT C++ Coding Standard
Overview
Content Tools
{"serverDuration": 86, "requestCorrelationId": "cff0b7462e64dd8a"}