safec  3.3
Safe C Library - ISO TR24731 Bounds Checking Interface
safe_compile.h File Reference
+ This graph shows which files directly or indirectly include this file:

Macros

#define __has_attribute(x)   0
 Since clang-5 most constraints can be caught at compile-time. More...
 
#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)
 

Macro Definition Documentation

◆ __has_attribute

#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.

◆ BOS_UNKNOWN

#define BOS_UNKNOWN   ((size_t)-1)

◆ _BOS_KNOWN

#define _BOS_KNOWN (   dest)    ((size_t)BOS(dest) != BOS_UNKNOWN)

◆ BOS

#define BOS (   dest)    BOS_UNKNOWN

◆ BOSW

#define BOSW (   dest)    BOS_UNKNOWN

◆ _BOS_CHK

#define _BOS_CHK (   dest)    0

◆ _BOSW_CHK

#define _BOSW_CHK (   dest)    0

◆ _BOS_ZERO

#define _BOS_ZERO (   dest)    0

◆ _BOS_NULL

#define _BOS_NULL (   dest)    0

◆ _BOS_OVR_N

#define _BOS_OVR_N (   dest,
  dmax 
)    0

◆ bos_chk_err

#define bos_chk_err   "error"

◆ _XSTR

#define _XSTR (   s)    _STR(s)

◆ _STR

#define _STR (   s)    #s

◆ BOS_CHK

#define BOS_CHK (   dest)

◆ BOSW_CHK

#define BOSW_CHK (   dest)

◆ BOS_CHK2

#define BOS_CHK2 (   buf,
  bufsize 
)

◆ BOSW_CHK2

#define BOSW_CHK2 (   buf,
  bufsize 
)

◆ BOS_OVR_BUTNULL

#define BOS_OVR_BUTNULL (   dest)

◆ BOSW_OVR_BUTNULL

#define BOSW_OVR_BUTNULL (   dest)

◆ BOS_CHK_BUTZERO

#define BOS_CHK_BUTZERO (   dest,
  slen 
)

◆ BOSW_CHK_BUTZERO

#define BOSW_CHK_BUTZERO (   dest,
  slen 
)

◆ BOS_OVR2

#define BOS_OVR2 (   buf,
  bufsize 
)

◆ BOSW_OVR2

#define BOSW_OVR2 (   buf,
  bufsize 
)

◆ BOS_OVR2Z

#define BOS_OVR2Z (   buf,
  bufsize 
)

◆ BOSW_OVR2Z

#define BOSW_OVR2Z (   buf,
  bufsize 
)

◆ BOS_OVR2_BUTZERO

#define BOS_OVR2_BUTZERO (   buf,
  bufsize 
)

◆ BOSW_OVR2_BUTZERO

#define BOSW_OVR2_BUTZERO (   buf,
  bufsize 
)

◆ BOS_OVR2_BUTNULL

#define BOS_OVR2_BUTNULL (   buf,
  bufsize 
)

◆ BOSW_OVR2_BUTNULL

#define BOSW_OVR2_BUTNULL (   buf,
  bufsize 
)

◆ VAL_OVR2

#define VAL_OVR2 (   value,
  vmax 
)

◆ VAL_OVR2_BUTZERO

#define VAL_OVR2_BUTZERO (   value,
  vmax 
)

◆ BOS_NULL

#define BOS_NULL (   buf)

◆ BOS_NULLPTR

#define BOS_NULLPTR (   buf)

◆ BOS_FMT

#define BOS_FMT (   fmt)

◆ BOS_ATTR

#define BOS_ATTR (   chk,
  msg 
)

Typedef Documentation

◆ constraint_handler_t

typedef void(* constraint_handler_t) (const char *restrict, void *restrict, errno_t)