set_constraint_handler_s, constraint_handler_t
Defined in header <stdlib.h>
|
||
constraint_handler_t set_constraint_handler_s( constraint_handler_t handler ); |
(since C11) | |
Configures the handler to be called by all bounds-checked functions on a runtime constraint violation or restores the default handler (if handler
is a null pointer)
The handler must be a pointer to function of type constraint_handler_t, which is defined as
Defined in header <stdlib.h>
|
||
typedef void (*constraint_handler_t)( const char *restrict msg, void *restrict ptr, |
(since C11) | |
On a runtime constraint violation, it is called with the following arguments:
errno_t
If set_constraint_handler_s
is never called, the default handler is implementation-defined: it may be abort_handler_s, ignore_handler_s, or some other implementation-defined handler.
- As with all bounds-checked functions,
set_constraint_handler_s
andconstraint_handler_t
are only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation and if the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before including<stdlib.h>
.
Parameters
handler | - | pointer to function of type constraint_handler_t or a null pointer |
Return value
A pointer to the previously-installed runtime constraints handler. (note: this pointer is never a null pointer because calling set_constraint_handler_s(NULL) sets up the system default handler)