Software Engineering Institute | Carnegie Mellon University
Software Engineering Institute | Carnegie Mellon University

Digital Library

Technical Note

Ranged Integers for the C Programming Language

  • Abstract

    This report describes an extension to the C programming language to introduce the notion of ranged integers, that is, integer types with a defined range of values. A variable of a ranged integer type will always have a value within the defined range as a result of initialization or assignment. Use of ranged integers would help prevent integer overflow errors and thus would result in more reliable and secure C programs. The syntax and semantics of ranged integers are presented, and some examples are given to illustrate their use.

  • Download

Cite This Report

SEI

Gennari, Jeff; Hedrick, Shaun; Long, Fred; Pincar, Justin; & Seacord, Robert. Ranged Integers for the C Programming Language. CMU/SEI-2007-TN-027. Software Engineering Institute, Carnegie Mellon University. 2007. http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265

IEEE

Gennari. Jeff, Hedrick. Shaun, Long. Fred, Pincar. Justin, and Seacord. Robert, "Ranged Integers for the C Programming Language," Software Engineering Institute, Carnegie Mellon University, Pittsburgh, Pennsylvania, Technical Note CMU/SEI-2007-TN-027, 2007. http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265

APA

Gennari, Jeff., Hedrick, Shaun., Long, Fred., Pincar, Justin., & Seacord, Robert. (2007). Ranged Integers for the C Programming Language (CMU/SEI-2007-TN-027). Retrieved March 26, 2019, from the Software Engineering Institute, Carnegie Mellon University website: http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265

CHI

Jeff Gennari, Shaun Hedrick, Fred Long, Justin Pincar, & Robert Seacord. Ranged Integers for the C Programming Language (CMU/SEI-2007-TN-027). Pittsburgh, PA: Software Engineering Institute, Carnegie Mellon University, 2007. http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265

MLA

Gennari, Jeff., Hedrick, Shaun., Long, Fred., Pincar, Justin., & Seacord, Robert. 2007. Ranged Integers for the C Programming Language (Technical Report CMU/SEI-2007-TN-027). Pittsburgh: Software Engineering Institute, Carnegie Mellon University. http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265

BibTex

@techreport{GennariRangedIntegers2007,
title={Ranged Integers for the C Programming Language},
author={Jeff Gennari and Shaun Hedrick and Fred Long and Justin Pincar and Robert Seacord},
year={2007},
number={CMU/SEI-2007-TN-027},
institution={Software Engineering Institute, Carnegie Mellon University},
address={Pittsburgh, PA},
url={http://resources.sei.cmu.edu/library/asset-view.cfm?AssetID=8265} }