|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3: C User's Guide Oracle Solaris Studio 12.3 Information Library|
A line of the form:
#assert predicate (token-sequence)
associates the token-sequence with the predicate in the assertion name space (separate from the space used for macro definitions). The predicate must be an identifier token.
asserts that predicate exists, but does not associate any token sequence with it.
The compiler provides the following predefined predicates by default (not in -Xc mode):
#assert system (unix) #assert machine (sparc) #assert machine (i386)(x86) #assert cpu (sparc) #assert cpu (i386)(x86)
#assert lint (on)
Any assertion may be removed by using #unassert, which uses the same syntax as assert. Using #unassert with no argument deletes all assertions on the predicate; specifying an assertion deletes only that assertion.
An assertion may be tested in a #if statement with the following syntax:
#if #predicate(non-empty token-list)
For example, the predefined predicate system can be tested with the following line, which evaluates true.