eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-contracts-macros.h File Reference

Go to the source code of this file.

Macros

#define ellipsis_contracts_assert(COND, ...)
 
#define ellipsis_contracts_assume(COND, ...)
 
#define ellipsis_contracts_conclusion(COND, ...)
 
#define ellipsis_contracts_fact(COND, ...)
 
#define ellipsis_contracts_invariant(COND, ...)
 
#define ellipsis_contracts_post(COND, ...)
 
#define ellipsis_contracts_pre(COND, ...)
 
#define ellipsis_contracts_premise(COND, ...)
 

Macro Definition Documentation

◆ ellipsis_contracts_assert

#define ellipsis_contracts_assert (   COND,
  ... 
)

An assertion COND that is checked (compile time if possible otherwise runtime) in the context of the invocation of this macro.

The second, optional, parameter is a string literal that should provide information for the case that the condition COND does not hold.

If the condition COND does not hold and is only checked a run time, the execution is aborted by means of a call to abort as a last resort.

Warning
You should organize your assertions such that they can be checked mostly at compile time.
See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_assume

#define ellipsis_contracts_assume (   COND,
  ... 
)

An assumption COND that holds in the context of the invocation of this macro.

Warning
In general, COND is not checked at that place, but it is assumed to hold for the code that is following.

The second, optional, parameter is a string literal that should provide information for the case that the condition COND does not hold.

If the condition COND does not hold, the execution has undefined behavior by means of the C standard macro unreachable.

See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_conclusion

#define ellipsis_contracts_conclusion (   COND,
  ... 
)

An assumption COND that is assumed after the containing function returns.

At the moment that is not much more than

defer { ellipsis_contracts_assume(COND, __VA_ARGS__); };
#define ellipsis_contracts_assume(COND,...)
Definition ellipsis-contracts-macros.h:64
#define defer
Mark the depending compound statement as being deferred until the current compound statement (the anc...
Definition ellipsis-defer.h:524

If you want real postconditions look into the mechanism of ellipsis-interface.h.

See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_fact

#define ellipsis_contracts_fact (   COND,
  ... 
)

An assumption COND that is assumed to hold at the start of the containing function and before the containing function returns.

At the moment that is not much more than combining ellipsis_contracts_premise and ellipsis_contracts_conclusion.

If you want real invariants look into the mechanism of ellipsis-interface.h.

Warning
You should organize your assumptions such that they can be checked mostly at compile time.
See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_invariant

#define ellipsis_contracts_invariant (   COND,
  ... 
)

An assertion COND that is checked (compile time if possible otherwise runtime) at the start of a function and before the containing function returns.

At the moment that is not much more than combining ellipsis_contracts_pre and ellipsis_contracts_post.

If you want real invariants look into the mechanism of ellipsis-interface.h.

Warning
You should organize your assertions such that they can be checked mostly at compile time.
See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_post

#define ellipsis_contracts_post (   COND,
  ... 
)

An assertion COND that is checked (compile time if possible otherwise runtime) before the containing function returns.

At the moment that is not much more than

defer { ellipsis_contracts_assert(COND, __VA_ARGS__); };
#define ellipsis_contracts_assert(COND,...)
Definition ellipsis-contracts-macros.h:54

If you want real postconditions look into the mechanism of ellipsis-interface.h.

Warning
You should organize your assertions such that they can be checked mostly at compile time.
See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_pre

#define ellipsis_contracts_pre (   COND,
  ... 
)

An assertion COND that is checked (compile time if possible otherwise runtime) at the start of the containing function.

At the moment that is not much more than ellipsis_contracts_assert. If you want real preconditions look into the mechanism of ellipsis-interface.h.

Warning
You should organize your assertions such that they can be checked mostly at compile time.
See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise

◆ ellipsis_contracts_premise

#define ellipsis_contracts_premise (   COND,
  ... 
)

An assumption COND that is assumed to hold at the start of the containing function.

At the moment that is not much more than ellipsis_contracts_assume. If you want real preconditions look into the mechanism of ellipsis-interface.h.

See also
ellipsis-contracts.h
ellipsis-contracts-macros.h
ellipsis-interface.h
Warning
This macro may not be undefined or changed otherwise