EPICS Base
7.0.7.0
|
An EPICS-specific replacement for ANSI C's assert. More...
Go to the source code of this file.
Macros | |
#define | epicsAssertAuthor 0 |
Optional string giving the author's name. | |
#define | assert(exp) |
Declare that a condition should be true. More... | |
#define | STATIC_JOIN(x, y) STATIC_JOIN2(x, y) |
#define | STATIC_JOIN2(x, y) x ## y |
#define | STATIC_ASSERT(expr) |
Declare a condition that should be true at compile-time. More... | |
To use this version just include:
instead of
If an assert() fails, it calls errlog indicating the program's author, file name, and line number. Under each OS there are specialized instructions assisting the user to diagnose the problem and generate a good bug report. For instance, under vxWorks, there are instructions on how to generate a stack trace, and on posix there are instructions about saving the core file. After printing the message the calling thread is suspended. An author may, before the above include line, optionally define a preprocessor macro named epicsAssertAuthor as a string that provides their name and email address if they wish to be contacted when the assertion fires.
This header also provides a compile-time assertion macro STATIC_ASSERT() which can be used to check a constant-expression at compile-time. The C or C++ compiler will flag an error if the expression evaluates to 0. The STATIC_ASSERT() macro can only be used where a typedef
is syntactically legal.
Definition in file epicsAssert.h.
#define assert | ( | exp | ) |
exp | Expression that should evaluate to True. |
Definition at line 71 of file epicsAssert.h.
#define STATIC_ASSERT | ( | expr | ) |
expr | A C/C++ const-expression that should evaluate to True. |
Definition at line 87 of file epicsAssert.h.