3.1.1. #assert

The #assert preprocessing extensions of System V release 4 are permitted. These enable definition and testing of predicate names.

Such names are in a namespace distinct from all other names, including macro names.

Syntax

#assert name
#assert name[(token-sequence)]

Where:

name

is a predicate name

token-sequence

is an optional sequence of tokens.

If the token sequence is omitted, name is not given a value.

If the token sequence is included, name is given the value token-sequence.

Example

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

#if #name(token-sequence)

This has the value 1 if a #assert of the name name with the token-sequence token-sequence has appeared, and 0 otherwise. A given predicate can be given more than one value at a given time.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential