BDE 4.14.0 Production release
|
Macros | |
#define | BSLA_USED |
Provide a macro to prevent elision of unused entities.
BSLA_USED
is activeThis component provides a preprocessor macro that will guarantee the emission of a local function, type, or variable whether it is used or not.
BSLA_USED
: This annotation indicates that the so-annotated function, variable, or type must be emitted even if it appears that it is not referenced.
BSLA_USED_IS_ACTIVE
: The macro BSLA_USED_IS_ACTIVE
is defined if BSLA_USED
expands to something with the desired effect; otherwise BSLA_USED_IS_ACTIVE
is not defined and BSLA_USED
expands to nothing.
This section illustrates intended use of this component.
First, we declare two unused static variables, one marked BSLA_UNUSED
and the other marked BSLA_USED
:
Finally, if we compile with clang and go into the debugger and stop in main
, which is in the same file and from which both variables are visible, we observe that the variable marked BSLA_UNUSED
cannot be accessed, but the variable marked BSLA_USED
can.
First, declare two unused static functions, one marked BSLA_UNUSED
and one marked BSLA_USED
:
Finally, if we compile with clang and go into the debugger, we find that we can put a breakpoint in the function marked BSLA_USED
, but not in the function marked BSLA_UNUSED
.
#define BSLA_USED |