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.

<strong>Compiler</strong>-specific Features<br />

void Variable_Attributes_transparent_union_0(transparent_union_t aUnion<br />

__attribute__ ((transparent_union)))<br />

{<br />

static int aStatic;<br />

aStatic +=aUnion.myint;<br />

}<br />

void Variable_Attributes_transparent_union_1()<br />

{<br />

int aLocal =0;<br />

float bLocal =0;<br />

Variable_Attributes_transparent_union_0(aLocal);<br />

Variable_Attributes_transparent_union_0(bLocal);<br />

}<br />

See also<br />

• __attribute__((transparent_union)) on page 4-38.<br />

4.5.8 __attribute__((unused))<br />

Normally, the compiler warns if a variable is declared but is never referenced. This<br />

attribute informs the compiler that you expect a variable to be unused and tells it not<br />

issue a warning if it is not used.<br />

Note<br />

This variable attribute is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

Example<br />

void Variable_Attributes_unused_0()<br />

{<br />

static int aStatic =0;<br />

int aUnused __attribute__ ((unused));<br />

int bUnused;<br />

aStatic++;<br />

}<br />

In this example, the compiler warns that bUnused is declared but never referenced, but<br />

does not warn about aUnused.<br />

Note<br />

The GNU compiler does not give any warning.<br />

4-46 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!