29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Language Extensions<br />

• New features of C99 on page 1-5 in the <strong>Compiler</strong> User <strong>Guide</strong>.<br />

3.3.2 long long<br />

The <strong>ARM</strong> compiler supports 64-bit integer types through the type specifiers long long<br />

and unsigned long long. They behave analogously to long and unsigned long with<br />

respect to the usual arithmetic conversions. __int64 is a synonym for long long.<br />

Integer constants can have:<br />

• an ll suffix to force the type of the constant to long long, if it fits, or to unsigned<br />

long long if it does not fit<br />

• a ull or llu suffix to force the type of the constant to unsigned long long.<br />

Format specifiers for printf() and scanf() can include ll to specify that the following<br />

conversion applies to a long long argument, as7 in %lld or %llu.<br />

Also, a plain integer constant is of type long long or unsigned long long if its value is<br />

large enough. There is a warning message from the compiler indicating the change. For<br />

example, in strict 1990 ISO Standard C 2147483648 has type unsigned long. In <strong>ARM</strong><br />

C and C++ it has the type long long. One consequence of this is the value of an<br />

expression such as:<br />

2147483648 > –1<br />

This expression evaluates to 0 in strict C and C++, and to 1 in <strong>ARM</strong> C and C++.<br />

The long long types are accommodated in the usual arithmetic conversions.<br />

See also<br />

• __int64 on page 4-9.<br />

3.3.3 restrict<br />

The restrict keyword is a C99 feature that enables you to ensure that different object<br />

pointer types and function parameter arrays do not point to overlapping regions of<br />

memory. Therefore, the compiler performs optimizations that can be otherwise<br />

prevented because of possible aliasing.<br />

Restrictions<br />

To enable the restrict keyword in C90 or C++, you must specify the --restrict option.<br />

The keywords __restrict and __restrict__ are supported as synonyms for restrict and<br />

are always available, regardless of whether --restrict is specified.<br />

3-8 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!