COMPILER(3) Library Functions Manual COMPILER(3)

NO_SANITIZE_ALIGNMENT, NO_SANITIZE_UNDEFINED, NO_SANITIZE_SIGNED_INTEGER_OVERFLOW, NO_SANITIZE_UNSIGNED_INTEGER_OVERFLOW, FALLTHROUGH, UNUSED, NDEBUG_UNUSED, STATIC_ASSERT, UNSAFE_CAST, countofcompiler macros

#include <libks/compiler.h>

__attribute__((NO_SANITIZE_ALIGNMENT))

__attribute__((NO_SANITIZE_UNDEFINED))

__attribute__((NO_SANITIZE_SIGNED_INTEGER_OVERFLOW))

__attribute__((NO_SANITIZE_UNSIGNED_INTEGER_OVERFLOW))


FALLTHROUGH;


UNUSED(variable);

NDEBUG_UNUSED(variable);

STATIC_ASSERT(expression, message);

UNSAFE_CAST(type, variable);

countof(variable);

The compiler macros can be used to instruct the compiler about certain properties of the source code.

The NO_SANITIZE_ALIGNMENT macro is intended to be used as an __attribute__ argument applicable to functions, instructing the compiler to omit the alignment sanitizer.

The NO_SANITIZE_UNDEFINED macro is intended to be used as an __attribute__ argument applicable to functions, instructing the compiler to omit the undefined behavior sanitizer.

The NO_SANITIZE_SIGNED_INTEGER_OVERFLOW macro is intended to be used as an __attribute__ argument applicable to functions, instructing the compiler to omit the signed integer overflow sanitizer.

The NO_SANITIZE_UNSIGNED_INTEGER_OVERFLOW macro is intended to be used as an __attribute__ argument applicable to functions, instructing the compiler to omit the unsigned integer overflow sanitizer.

The FALLTHROUGH macro annotates a switch case as intentionally continuing execution to the next case.

The () macro annotates variable as being unused.

The () macro annotates variable as being unused if NDEBUG is defined.

The () macro ensures expression evalutes non-zero at compile time.

The () macro is performs an unsafe cast, tricking the compiler to not emit a warning nor error.

The () macro returns the number of elements in variable which is required to be an array.

Anton Lindqvist <anton@basename.se>

OpenBSD 7.8 August 26, 2023 COMPILER(3)