11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Library FunctionsASSERTSynopsis#include void assert (int e)DescriptionThis macro is used for debugging purposes; the basic method of usage is to place assertions liberallythroughout your code at points where correct operation of the code depends upon certain conditionsbeing true initially. An assert() routine may be used to ensure at run time that an assumption holdstrue. For example, the following statement asserts that the pointer tp is not equal to NULL:assert(tp);If at run time the expression evaluates to false, the program will abort with a message identifyingthe source file and line number of the assertion, and the expression used as an argument to it. A fullerdiscussion of the uses of assert() is impossible in limited space, but it is closely linked to methodsof proving program correctness.ExampleNotevoidptrfunc (struct xyz * tp){assert(tp != 0);}When required for ROM based systems, the underlying routine _fassert(...) will need to be implementedby the user.123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!