safec 3.8.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
Macros | |
#define | __has_attribute(x) 0 |
Since clang-5 most constraints can be caught at compile-time. | |
#define | BOS_UNKNOWN ((size_t)-1) |
#define | _BOS_KNOWN(dest) ((size_t)BOS(dest) != BOS_UNKNOWN) |
#define | BOS(dest) BOS_UNKNOWN |
#define | BOSW(dest) BOS_UNKNOWN |
#define | _BOS_CHK(dest) 0 |
#define | _BOSW_CHK(dest) 0 |
#define | _BOS_ZERO(dest) 0 |
#define | _BOS_NULL(dest) 0 |
#define | _BOS_OVR_N(dest, dmax) 0 |
#define | bos_chk_err "error" |
#define | _XSTR(s) _STR(s) |
#define | _STR(s) #s |
#define | BOS_CHK(dest) |
#define | BOSW_CHK(dest) |
#define | BOS_CHK2(buf, bufsize) |
#define | BOSW_CHK2(buf, bufsize) |
#define | BOS_OVR_BUTNULL(dest) |
#define | BOSW_OVR_BUTNULL(dest) |
#define | BOS_CHK_BUTZERO(dest, slen) |
#define | BOSW_CHK_BUTZERO(dest, slen) |
#define | BOS_OVR2(buf, bufsize) |
#define | BOSW_OVR2(buf, bufsize) |
#define | BOS_OVR2Z(buf, bufsize) |
#define | BOSW_OVR2Z(buf, bufsize) |
#define | BOS_OVR2_BUTZERO(buf, bufsize) |
#define | BOSW_OVR2_BUTZERO(buf, bufsize) |
#define | BOS_OVR2_BUTNULL(buf, bufsize) |
#define | BOSW_OVR2_BUTNULL(buf, bufsize) |
#define | VAL_OVR2(value, vmax) |
#define | VAL_OVR2_BUTZERO(value, vmax) |
#define | BOS_NULL(buf) |
#define | BOS_NULLPTR(buf) |
#define | BOS_FMT(fmt) |
#define | BOS_ATTR(chk, msg) |
Typedefs | |
typedef void(* | constraint_handler_t) (const char *restrict, void *restrict, errno_t) |
#define __has_attribute | ( | x | ) | 0 |
Since clang-5 most constraints can be caught at compile-time.
For pointer sizes we need BOS/__builtin_object_size(), for diagnostics attribute((diagnose_if())) gcc violations might be caught with _Static_assert, but this is limited.
#define BOS_UNKNOWN ((size_t)-1) |
#define _BOS_KNOWN | ( | dest | ) | ((size_t)BOS(dest) != BOS_UNKNOWN) |
#define BOS | ( | dest | ) | BOS_UNKNOWN |
#define BOSW | ( | dest | ) | BOS_UNKNOWN |
#define _BOS_CHK | ( | dest | ) | 0 |
#define _BOSW_CHK | ( | dest | ) | 0 |
#define _BOS_ZERO | ( | dest | ) | 0 |
#define _BOS_NULL | ( | dest | ) | 0 |
#define bos_chk_err "error" |
#define _XSTR | ( | s | ) | _STR(s) |
#define _STR | ( | s | ) | #s |
#define BOS_CHK2 | ( | buf, | |
bufsize | |||
) |
#define BOSW_CHK2 | ( | buf, | |
bufsize | |||
) |
#define BOS_OVR_BUTNULL | ( | dest | ) |
#define BOSW_OVR_BUTNULL | ( | dest | ) |
#define BOS_OVR2 | ( | buf, | |
bufsize | |||
) |
#define BOSW_OVR2 | ( | buf, | |
bufsize | |||
) |
#define BOS_OVR2Z | ( | buf, | |
bufsize | |||
) |
#define BOSW_OVR2Z | ( | buf, | |
bufsize | |||
) |
#define BOS_OVR2_BUTZERO | ( | buf, | |
bufsize | |||
) |
#define BOSW_OVR2_BUTZERO | ( | buf, | |
bufsize | |||
) |
#define BOS_OVR2_BUTNULL | ( | buf, | |
bufsize | |||
) |
#define BOSW_OVR2_BUTNULL | ( | buf, | |
bufsize | |||
) |
#define VAL_OVR2 | ( | value, | |
vmax | |||
) |
#define VAL_OVR2_BUTZERO | ( | value, | |
vmax | |||
) |
#define BOS_NULL | ( | buf | ) |
#define BOS_NULLPTR | ( | buf | ) |
EXTERN int BOS_FMT | ( | fmt | ) |
#define BOS_ATTR | ( | chk, | |
msg | |||
) |
typedef void(* constraint_handler_t) (const char *restrict, void *restrict, errno_t) |