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. 03. Expressions (EXP)
Page Information
Title:
Rec. 03. Expressions (EXP)
Author:
Barbara White
Mar 05, 2015
Last Changed by:
David Svoboda
Mar 15, 2022
Tiny Link:
(useful for email)
https://wiki.sei.cmu.edu/confluence/x/aNUxBQ
Export As:
Word
·
PDF
Hierarchy
Parent Page
Page:
3 Recommendations
Children (16)
Page:
EXP00-C. Use parentheses for precedence of operation
Page:
EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators
Page:
EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members
Page:
EXP05-C. Do not cast away a const qualification
Page:
EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions
Page:
EXP08-C. Ensure pointer arithmetic is used correctly
Page:
EXP09-C. Use sizeof to determine the size of a type or variable
Page:
EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
Page:
EXP11-C. Do not make assumptions regarding the layout of structures with bit-fields
Page:
EXP12-C. Do not ignore values returned by functions
Show all...
Page:
EXP13-C. Treat relational and equality operators as if they were nonassociative
Page:
EXP14-C. Beware of integer promotion when performing bitwise operations on integer types smaller than int
Page:
EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement
Page:
EXP16-C. Do not compare function pointers to constant values
Page:
EXP19-C. Use braces for the body of an if, for, or while statement
Page:
EXP20-C. Perform explicit tests to determine success, true and false, and equality
Hide...
Labels
Global Labels (3)
recommendation-list
exp
section
Recent Changes
Time
Editor
Mar 15, 2022 09:44
David Svoboda
View Changes
Dec 03, 2018 15:24
Derek Leung
View Changes
Nov 16, 2017 14:41
Will Snavely
View Changes
Nov 16, 2017 14:16
Will Snavely
View Changes
Feb 26, 2017 17:30
Will Snavely
View Page History
Outgoing Links
External Links (5)
https://confluence/label/seccode/exp
https://confluence/label/seccode/recommendation
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
SEI CERT C Coding Standard (1)
Home page:
SEI CERT C Coding Standard
Overview
Content Tools
{"serverDuration": 84, "requestCorrelationId": "83e7f64374b1f2a4"}