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 />

In non-GNU mode, extern is ignored and the functionality is the same as<br />

inline foo() for C++. In C, you must use __inline. See Extern inline<br />

functions on page 5-19 for more information.<br />

Mode<br />

Supported in GNU mode only for C90.<br />

3.7.12 Labels as values<br />

The compiler supports GCC labels as values using the && operator.<br />

Mode<br />

Supported in GNU mode for C and C++.<br />

Examples<br />

A table of labels:<br />

int f(int n)<br />

{<br />

void *const table[] = { &&a1, &&a2};<br />

goto *table[n];<br />

a1: return 1;<br />

a2: return 2;<br />

}<br />

A label used for continuation:<br />

void *toggle(void *lab, int *x)<br />

{<br />

if (lab) goto *lab;<br />

a1: *x = 1; return &&a2;<br />

a2: *x = 0; return &&a1;<br />

}<br />

3.7.13 Pointer arithmetic<br />

You can perform arithmetic on void pointers and function pointers.<br />

The size of a void type or a function type is defined to be 1.<br />

Mode<br />

Supported in GNU mode for C90 and C99 only.<br />

3-30 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!