|
lucenaBAL 2.0.1.2
Lucena Build Abstraction Library for C++
|
Provides compiler-agnostic control over compiler diagnostics, warnings, and pragmas. More...
Macros | |
| #define | LBAL_CPP_WARNING(LBAL_CPP_WARNING_message) |
| Generate a compile-time warning. | |
| #define | LBAL_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS |
| Disable warning generation if the compiler encounters a #pragma it doesn’t recognize. | |
| #define | LBAL_DIAGNOSTIC_POP |
| Dispose of the current diagnostic context. | |
| #define | LBAL_DIAGNOSTIC_PUSH |
| Begin a new diagnostic context. | |
| #define | LBAL_PRAGMA(LBAL_PRAGMA_pragma) |
| Invoke the specified pragma. | |
Provides compiler-agnostic control over compiler diagnostics, warnings, and pragmas.
Currently, this provides a minimal set of controls geared specifically towards allowing the generation of compile-time warnings. This section may gain more controls as needs arise.
| #define LBAL_CPP_WARNING | ( | LBAL_CPP_WARNING_message | ) |
Generate a compile-time warning.
This is intended to be a cross-platform replacement for the C preprocessor #warning directive, which is sadly unsupported by most compilers that aren’t clang. Notably, warnings generate visible diagnostic messages when compiling, but do not halt compilation. Behaviorally, these warnings are preprocesor constructs, and are subject to the same limitations as #error, which are more rigid than those of, for example, static_assert. In particular, assume there is no macro substitution, and that constructs that depend upon compile-time evaluation are unavailable (e.g., Standard Library type traits).
| #define LBAL_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS |
Disable warning generation if the compiler encounters a #pragma it doesn’t recognize.
Not all compilers expose this functionality, but most do.
| #define LBAL_DIAGNOSTIC_POP |
Dispose of the current diagnostic context.
This will revert any settings changed by diagnostic controls since the last call to LBAL_DIAGNOSTIC_PUSH.
| #define LBAL_DIAGNOSTIC_PUSH |
Begin a new diagnostic context.
Any diagnostic controls engaged after this call may be reverted to their previous settings with a subsequent call to LBAL_DIAGNOSTIC_POP.
| #define LBAL_PRAGMA | ( | LBAL_PRAGMA_pragma | ) |
Invoke the specified pragma.
This is mostly for use as an internal macro, as its pragmatic use in generic code is profoundly limited.