Quick Links: |
Provide macros for portable use of compiler annotations. More...
Components | |
Component bsla_annotations | |
Provide support for compiler annotations for compile-time safety. | |
Component bsla_deprecated | |
Provide compiler-hint macros to indicate deprecated entities. | |
Component bsla_error | |
Provide a macro to emit an error message when a function is called. | |
Component bsla_fallthrough | |
Provide a macro to suppress warnings on | |
Component bsla_format | |
Provide a macro to indicate that a return value is a format string. | |
Component bsla_maybeunused | |
Provide a macro to suppress "unused" warnings. | |
Component bsla_nodiscard | |
Provide a macro for warning about ignored function results. | |
Component bsla_nonnullarg | |
Provide macros to hint at null arguments to functions. | |
Component bsla_noreturn | |
Provide a macro to issue a compiler warning if a function returns. | |
Component bsla_nullterminated | |
Provide macros for use with | |
Component bsla_printf | |
Provide a macro to indicate | |
Component bsla_scanf | |
Provide a macro for checking | |
Component bsla_unreachable | |
Provide a compiler-hint macro to indicate unreachable code. | |
Component bsla_unused: DEPRECATED | |
Provide a macro to suppress "unused" warnings. | |
Component bsla_used | |
Provide a macro to prevent elision of unused entities. | |
Component bsla_warning | |
Provide a macro to emit a warning when a function is called. |
bsla
package provides a variety of macros that expand to annotations to provide hints to the compiler, to suppress or emit compiler warnings or errors. BSLA_{X}
, there is a corresponding macro, BSLA_{X}_IS_ACTIVE
, which is always defined to an integer, and expands to 0 if BSLA_{X}
expands to nothing and 1 if BSLA_{X}
expands to an annotation and the annotation works. There are situations where compilers will "tolerate" an annotation -- the annotation won't be reported as a syntax error, but it will have no effect. In those cases, BSLA_{X}
will expand to nothing and BSLA_{X}_IS_ACTIVE
will be 0. bsla
package currently has 16 components having 3 levels of physical dependency. The list below shows the hierarchical ordering of the components. The order of components within each level is not architecturally significant, just alphabetical. 3. bsla_annotations 2. bsla_used 1. bsla_deprecated bsla_error bsla_fallthrough bsla_format bsla_maybeunused bsla_nodiscard bsla_nonnullarg bsla_noreturn bsla_nullterminated bsla_printf bsla_scanf bsla_unreachable bsla_unused !DEPRECATED! bsla_warning
bsla_annotations
: bsla_deprecated
: bsla_error
: bsla_fallthrough
: switch
fall-throughs.bsla_format
: bsla_maybeunused
: bsla_nodiscard
: bsla_nonnullarg
: bsla_noreturn
: bsla_nullterminated
: NULL
-terminated variadic functions.bsla_printf
: printf
-style arguments.bsla_scanf
: scanf
-style format strings.bsla_unreachable
: bsla_unused
: DEPRECATED bsla_used
: bsla_warning
: bsla
package. See the documentation in each component for full details. bsla
package. The macros that are transitively included by this component correspond to various compiler features, and can be used to annotate code for specific compile-time safety checks. case
or default
of a switch
statement to another. On compilers where the appropriate attribute is not supported, the macro expands to nothing. printf
-style format specification, and that the function will return a printf
-style format string with an equivalent specification. NULL
value, or, in the case of BSLA_NULLTERMINATEDAT
, by a NULL
value at a certain index. Note that the terminating NULL
must actually be NULL
; passing 0 in it's place will result in a warning. printf
-style format string, and arguments starting at a certain index in the argument list to be formatted according to that string. scanf
-style format string, and that the arguments starting at a certain index are to be checked for compatibility with that format string.