29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Compiler</strong> Coding Practices<br />

5.78 Extended integer types and functions in and in C99<br />

In C90, <strong>the</strong> long data type can serve both as <strong>the</strong> largest integral type, and as a 32-bit container.<br />

C99 removes this ambiguity through <strong>the</strong> new standard library header files and<br />

.<br />

The header file introduces <strong>the</strong> new types:<br />

• intmax_t and uintmax_t, that are maximum width signed and unsigned integer types<br />

• intptr_t and unintptr_t, that are integer types capable of holding signed and unsigned<br />

object pointers.<br />

The header file provides library functions <strong>for</strong> manipulating values of type<br />

intmax_t, including:<br />

intmax_t imaxabs(intmax_t x); // absolute value of x<br />

imaxdiv_t imaxdiv(intmax_t x, intmax_t y) // returns <strong>the</strong> quotient and remainder<br />

// of x / y<br />

These header files are also available in C90 and C++.<br />

5.78.1 See also<br />

Concepts<br />

• New library features of C99 on page 5-79.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 5-96<br />

ID061811<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!