assert

Format: assert logic_expression

This command is a useful shortcut for the a command when a simple assertion is desired. (See a) An assertion is set that will stop the program if logic_expression evaluates to true, and print out that the program was stopped by logic_expression. For example:

assert foo >= 0

is equivalent to:

a if (foo >= 0) {"Stopped by assertion: foo >= 0\n"; halt}


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.