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

3.1 Preprocessor extensions<br />

The compiler supports several extensions to the preprocessor, including the #assert<br />

preprocessing extensions of System V release 4.<br />

3.1.1 #assert<br />

The #assert preprocessing extensions of System V release 4 are permitted. These<br />

enable definition and testing of predicate names.<br />

Such names are in a namespace distinct from all other names, including macro names.<br />

Syntax<br />

#assert name<br />

#assert name[(token-sequence)]<br />

Where:<br />

name<br />

token-sequence<br />

is a predicate name<br />

is an optional sequence of tokens.<br />

If the token sequence is omitted, name is not given a value.<br />

If the token sequence is included, name is given the value<br />

token-sequence.<br />

Example<br />

A predicate name defined using #assert can be tested in a #if expression, for example:<br />

#if #name(token-sequence)<br />

This has the value 1 if a #assert of the name name with the token-sequence<br />

token-sequence has appeared, and 0 otherwise. A given predicate can be given more<br />

than one value at a given time.<br />

See also<br />

• #unassert on page 3-3.<br />

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