04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Language Extensions<br />

3.6.3 Anonymous classes, structures and unions<br />

Anonymous classes, structures, and unions are supported as an extension. Anonymous<br />

structures and unions are supported in C and C++.<br />

Anonymous unions are available by default in C++. However, you must specify the<br />

anon_unions pragma if you want to use:<br />

• anonymous unions and structures in C<br />

• anonymous classes and structures in C++.<br />

An anonymous union can be introduced into a containing class by a typedef name.<br />

Unlike a true anonymous union, it does not have to be declared directly. For example:<br />

typedef union<br />

{<br />

int i, j;<br />

} U; // U identifies a reusable anonymous union.<br />

#pragma anon_unions<br />

class A<br />

{<br />

U; // Okay -- references to A::i and A::j are allowed.<br />

};<br />

The extension also enables anonymous classes and anonymous structures, as long as<br />

they have no C++ features. For example, no static data members or member functions,<br />

no non public members, and no nested types (except anonymous classes, structures, or<br />

unions) are allowed in anonymous classes and anonymous structures. For example:<br />

#pragma anon_unions<br />

struct A<br />

{<br />

struct<br />

{<br />

int i, j;<br />

}; // Okay -- references to A::i and A::j are allowed.<br />

};<br />

See also<br />

• Unnamed fields on page 3-32<br />

• #pragma anon_unions, #pragma no_anon_unions on page 4-58.<br />

3.6.4 Assembler labels<br />

Assembler labels specify the assembler name to use for a C symbol. For example, you<br />

might have assembler code and C code that uses the same symbol name, such as<br />

counter. Therefore, you can export a different name to be used by the assembler:<br />

3-20 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!