blob: e933c0e5f9dd3615025b16c88f0cfea603902eb8 [file] [log] [blame]
<html lang="en">
<head>
<title>Integers implementation - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="C-Implementation.html#C-Implementation" title="C Implementation">
<link rel="prev" href="Characters-implementation.html#Characters-implementation" title="Characters implementation">
<link rel="next" href="Floating-point-implementation.html#Floating-point-implementation" title="Floating point implementation">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Integers-implementation"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Floating-point-implementation.html#Floating-point-implementation">Floating point implementation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Characters-implementation.html#Characters-implementation">Characters implementation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="C-Implementation.html#C-Implementation">C Implementation</a>
<hr>
</div>
<h3 class="section">4.5 Integers</h3>
<ul>
<li><cite>Any extended integer types that exist in the implementation (C99 6.2.5).</cite>
<p>GCC does not support any extended integer types.
<!-- The __mode__ attribute might create types of precisions not -->
<!-- otherwise supported, but the syntax isn't right for use everywhere -->
<!-- the standard type names might be used. Predefined typedefs should -->
<!-- be used if any extended integer types are to be defined. The -->
<!-- __int128_t and __uint128_t typedefs are not extended integer types -->
<!-- as they are generally longer than the ABI-specified intmax_t. -->
<li><cite>Whether signed integer types are represented using sign and magnitude,
two's complement, or one's complement, and whether the extraordinary value
is a trap representation or an ordinary value (C99 6.2.6.2).</cite>
<p>GCC supports only two's complement integer types, and all bit patterns
are ordinary values.
<li><cite>The rank of any extended integer type relative to another extended
integer type with the same precision (C99 6.3.1.1).</cite>
<p>GCC does not support any extended integer types.
<!-- If it did, there would only be one of each precision and signedness. -->
<li><cite>The result of, or the signal raised by, converting an integer to a
signed integer type when the value cannot be represented in an object of
that type (C90 6.2.1.2, C99 6.3.1.3).</cite>
<p>For conversion to a type of width N, the value is reduced
modulo 2^N to be within range of the type; no signal is raised.
<li><cite>The results of some bitwise operations on signed integers (C90
6.3, C99 6.5).</cite>
<p>Bitwise operators act on the representation of the value including
both the sign and value bits, where the sign bit is considered
immediately above the highest-value value bit. Signed &lsquo;<samp><span class="samp">&gt;&gt;</span></samp>&rsquo; acts
on negative numbers by sign extension.
<p>GCC does not use the latitude given in C99 only to treat certain
aspects of signed &lsquo;<samp><span class="samp">&lt;&lt;</span></samp>&rsquo; as undefined, but this is subject to
change.
<li><cite>The sign of the remainder on integer division (C90 6.3.5).</cite>
<p>GCC always follows the C99 requirement that the result of division is
truncated towards zero.
</ul>
</body></html>