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. 04. Integers (INT)
Page Information
Title:
Rec. 04. Integers (INT)
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/a9UxBQ
Export As:
Word
·
PDF
Hierarchy
Parent Page
Page:
3 Recommendations
Children (16)
Page:
INT00-C. Understand the data model used by your implementation(s)
Page:
INT01-C. Use rsize_t or size_t for all integer values representing the size of an object
Page:
INT02-C. Understand integer conversion rules
Page:
INT04-C. Enforce limits on integer values originating from tainted sources
Page:
INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
Page:
INT07-C. Use only explicitly signed or unsigned char type for numeric values
Page:
INT08-C. Verify that all integer values are in range
Page:
INT09-C. Ensure enumeration constants map to unique values
Page:
INT10-C. Do not assume a positive remainder when using the % operator
Page:
INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression
Show all...
Page:
INT13-C. Use bitwise operators only on unsigned operands
Page:
INT14-C. Avoid performing bitwise and arithmetic operations on the same data
Page:
INT15-C. Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types
Page:
INT16-C. Do not make assumptions about representation of signed integers
Page:
INT17-C. Define integer constants in an implementation-independent manner
Page:
INT18-C. Evaluate integer expressions in a larger size before comparing or assigning to that size
Hide...
Labels
Global Labels (4)
recommendation-list
conversion
int
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/int
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
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…
SEI CERT C Coding Standard (1)
Home page:
SEI CERT C Coding Standard
Overview
Content Tools
{"serverDuration": 89, "requestCorrelationId": "d6881d54c0e9e950"}