-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStackTraceMacros.h
71 lines (68 loc) · 3.89 KB
/
StackTraceMacros.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef included_StackTraceMacros
#define included_StackTraceMacros
// Disable/Enable warnings
// clang-format off
#ifndef STACKTRACE_DISABLE_WARNINGS
#if defined( _MSC_VER )
#define STACKTRACE_DISABLE_WARNINGS __pragma( warning( push, 0 ) )
#define STACKTRACE_ENABLE_WARNINGS __pragma( warning( pop ) )
#elif defined( __clang__ )
#define STACKTRACE_DISABLE_WARNINGS \
_Pragma( "clang diagnostic push" ) \
_Pragma( "clang diagnostic ignored \"-Wall\"" ) \
_Pragma( "clang diagnostic ignored \"-Wextra\"" ) \
_Pragma( "clang diagnostic ignored \"-Wunused-private-field\"" ) \
_Pragma( "clang diagnostic ignored \"-Wdeprecated-declarations\"" ) \
_Pragma( "clang diagnostic ignored \"-Winteger-overflow\"" ) \
_Pragma( "clang diagnostic ignored \"-Winconsistent-missing-override\"" ) \
_Pragma( "clang diagnostic ignored \"-Wimplicit-int-float-conversion\"" )
#define STACKTRACE_ENABLE_WARNINGS _Pragma( "clang diagnostic pop" )
#elif defined( __INTEL_COMPILER )
#if defined( __INTEL_LLVM_COMPILER )
#define STACKTRACE_DISABLE_WARNINGS _Pragma( "warning (push)" )
#define STACKTRACE_ENABLE_WARNINGS _Pragma( "warning(pop)" )
#else
#define STACKTRACE_DISABLE_WARNINGS \
_Pragma( "warning (push)" ) \
_Pragma( "warning disable 488" ) \
_Pragma( "warning disable 1011" ) \
_Pragma( "warning disable 61" ) \
_Pragma( "warning disable 1478" ) \
_Pragma( "warning disable 488" ) \
_Pragma( "warning disable 2651" )
#define STACKTRACE_ENABLE_WARNINGS _Pragma( "warning(pop)" )
#endif
#elif defined( __GNUC__ )
#define STACKTRACE_DISABLE_WARNINGS \
_Pragma( "GCC diagnostic push" ) \
_Pragma( "GCC diagnostic ignored \"-Wpragmas\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wall\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wextra\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wpedantic\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wunused-local-typedefs\"" ) \
_Pragma( "GCC diagnostic ignored \"-Woverloaded-virtual\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wunused-parameter\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wdeprecated-copy\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wdeprecated-declarations\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wvirtual-move-assign\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wunused-function\"" ) \
_Pragma( "GCC diagnostic ignored \"-Woverflow\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wignored-qualifiers\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wenum-compare\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wsign-compare\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wterminate\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wimplicit-fallthrough\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wmaybe-uninitialized\"" ) \
_Pragma( "GCC diagnostic ignored \"-Winaccessible-base\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wclass-memaccess\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wcast-function-type\"" ) \
_Pragma( "GCC diagnostic ignored \"-Waggressive-loop-optimizations\"" )
#define STACKTRACE_ENABLE_WARNINGS _Pragma( "GCC diagnostic pop" )
#else
#define STACKTRACE_DISABLE_WARNINGS
#define STACKTRACE_ENABLE_WARNINGS
#endif
#endif
// clang-format on
#endif