SA_Support
Sapphire's Suite's C++ Support library.
Loading...
Searching...
No Matches
Pragma.hpp File Reference

Pragma directives support file. More...

#include <SA/Support/Compilers.hpp>
#include <SA/Support/Stringify.hpp>

Go to the source code of this file.

Macros

#define SA_PRAGMA_SDWARN(_warnName, _warnCode)
 Start a disabled-warning segment .
 
#define SA_PRAGMA_EDWARN()   __SA_PRAGMA_POP
 End previous disabled-warning segment .
 
#define SA_PRAGMA_SDWARN_GNU(_warnName)
 Start a disabled-warning segment Enabled on GNU and Clang only
 
#define SA_PRAGMA_EDWARN_GNU()
 
#define SA_PRAGMA_SDWARN_MSVC(_warnCode)
 Start a disabled-warning segment , enabled on MSVC only .
 
#define SA_PRAGMA_EDWARN_MSVC()
 

Detailed Description

Pragma directives support file.

Source: https://www.fluentcpp.com/2019/08/30/how-to-disable-a-warning-in-cpp/

GCC Source: https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html MSVC Source: https://docs.microsoft.com/en-us/cpp/preprocessor/warning

Macro Definition Documentation

◆ SA_PRAGMA_EDWARN

#define SA_PRAGMA_EDWARN ( )    __SA_PRAGMA_POP

End previous disabled-warning segment .

Enable back warning disabled by previous SA_PRAGMA_SDWARN using pragma directive.

If no SA_PRAGMA_SDWARN has been called before, the behavior is undefined .

◆ SA_PRAGMA_EDWARN_GNU

#define SA_PRAGMA_EDWARN_GNU ( )

End a disabled-warning segment. Enabled on GNU and Clang only

◆ SA_PRAGMA_EDWARN_MSVC

#define SA_PRAGMA_EDWARN_MSVC ( )

End a disabled-warning segment. Enabled on MSVC only

◆ SA_PRAGMA_SDWARN

#define SA_PRAGMA_SDWARN ( _warnName,
_warnCode )
Value:
__SA_PRAGMA_PUSH\
__SA_PRAGMA_DISABLE_WARN(_warnName, _warnCode)

Start a disabled-warning segment .

Disable warning using pragma directive until SA_PRAGMA_EDWARN().

Parameters
[in]_warnNameName of the warning to disable.
[in]_warnCodeCode of the warning to disable.