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.

C and C++ Implementation Details<br />

5.1 C and C++ implementation details<br />

This section describes language implementation details common to both C and C++.<br />

5.1.1 Character sets and identifiers<br />

The following points apply to the character sets and identifiers expected by the<br />

compiler:<br />

• Uppercase and lowercase characters are distinct in all internal and external<br />

identifiers. An identifier can also contain a dollar ($) character unless the<br />

--strict compiler option is specified. To permit dollar signs in identifiers with the<br />

--strict option, also use the --dollar command-line option.<br />

• Calling setlocale(LC_CTYPE, "ISO8859-1") makes the isupper() and islower()<br />

functions behave as expected over the full 8-bit Latin-1 alphabet, rather than over<br />

the 7-bit ASCII subset. The locale must be selected at link-time. (See Tailoring<br />

locale and CTYPE using C macros on page 2-60 in the Libraries <strong>Guide</strong>)<br />

• Source files are compiled according to the currently selected locale. You might<br />

have to select a different locale, with the --locale command-line option, if the<br />

source file contains non-ASCII characters. See Invoking the <strong>ARM</strong> compiler on<br />

page 2-2 in the <strong>Compiler</strong> User <strong>Guide</strong> for more information.<br />

• The <strong>ARM</strong> compiler supports multibyte character sets, such as Unicode.<br />

• Other properties of the source character set are host-specific.<br />

The properties of the execution character set are target-specific. The <strong>ARM</strong> C and C++<br />

libraries support the ISO 8859-1 (Latin-1 Alphabet) character set with the following<br />

consequences:<br />

• The execution character set is identical to the source character set.<br />

• There are eight bits in a character in the execution character set.<br />

• There are four characters (bytes) in an int. If the memory system is:<br />

Little-endian The bytes are ordered from least significant at the lowest<br />

address to most significant at the highest address.<br />

Big-endian The bytes are ordered from least significant at the highest<br />

address to most significant at the lowest address.<br />

• In C all character constants have type int. In C++ a character constant containing<br />

one character has the type char and a character constant containing more than one<br />

character has the type int. Up to four characters of the constant are represented in<br />

5-2 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!