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

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

Mode<br />

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

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

Errors<br />

The compiler generates a warning if it detects arithmetic on void pointers or function<br />

pointers.<br />

Example<br />

int ptr_arith_0(void)<br />

{<br />

void * pointer;<br />

return sizeof *pointer;<br />

}<br />

int ptr_arith_1(void)<br />

{<br />

static int diff;<br />

diff = ptr_arith_0 - ptr_arith_1;<br />

}<br />

return sizeof ptr_arith_0;<br />

3.7.13 Statement expressions<br />

Statement expressions enable you to place whole sections of code, including<br />

declarations, within braces ({ }) .<br />

The result of a statement expression is the final item in the statement list.<br />

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