![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
arene-base provides facilities for uniformly suppressing compiler diagnostics in a cross-compiler manner without exposing #pragma to user code. The public header is:
The process for suppressing one or more diagnostics is as follows:
ARENE_IGNORE_START() macro.ARENE_IGNORE_XXX(diagnostic, rational) macros as appropraite. ALWAYS INCLUDE JUSTIFICATION IN THE RATIONAL FIELD!.ARENE_IGNORE_END() macro.The amount of code contained between ARENE_IGNORE_START() and ARENE_IGNORE_END() should be the minimum amount of logic possible. Do not simply suppress diagnostics at the start of a source file and disable them at the end.
Example usage of suppressing -Wfloat-equal in an implementation where an exact floating point comparison to the precise value of positive zero is desired:
| Macro | Description |
|---|---|
ARENE_IGNORE_GCC(s, comment) | The diagnostic should only be attempted to be suppressed when compiling with gcc |
ARENE_IGNORE_CLANG(s, comment) | The diagnostic should only be attempted to be suppressed when compiling with clang |
ARENE_IGNORE_ALL(s, comment) | The diagnostic should always be attempted to be suppressed |
ARENE_IGNORE_ALL only supports clang and gcc.ARENE_IGNORE_ALL which is unknown to the current compiler, this generally will result in a compiler error. Only use this when you are positive that the given diagnostic name is the same across all compilers.