File indexing completed on 2025-01-17 09:55:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef DIAGNOSTICS_H
0017 #define DIAGNOSTICS_H
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifdef __GNUC__
0034 # define DIAGNOSTIC_PUSH _Pragma ("GCC diagnostic push")
0035 # define DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop")
0036
0037
0038 # define DIAGNOSTIC_STRINGIFY_1(x) #x
0039 # define DIAGNOSTIC_STRINGIFY(x) DIAGNOSTIC_STRINGIFY_1 (x)
0040
0041 # define DIAGNOSTIC_IGNORE(option) \
0042 _Pragma (DIAGNOSTIC_STRINGIFY (GCC diagnostic ignored option))
0043 # define DIAGNOSTIC_ERROR(option) \
0044 _Pragma (DIAGNOSTIC_STRINGIFY (GCC diagnostic error option))
0045 #else
0046 # define DIAGNOSTIC_PUSH
0047 # define DIAGNOSTIC_POP
0048 # define DIAGNOSTIC_IGNORE(option)
0049 #endif
0050
0051 #if defined (__clang__)
0052
0053 # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
0054 # define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
0055 DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
0056 # define DIAGNOSTIC_IGNORE_REGISTER DIAGNOSTIC_IGNORE ("-Wregister")
0057
0058 # if __has_warning ("-Wenum-compare-switch")
0059 # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \
0060 DIAGNOSTIC_IGNORE ("-Wenum-compare-switch")
0061 # endif
0062
0063 # define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
0064 DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
0065
0066 # if __has_warning ("-Wuser-defined-warnings")
0067 # define DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS \
0068 DIAGNOSTIC_IGNORE ("-Wuser-defined-warnings")
0069 # endif
0070
0071 # if __has_warning ("-Wunused-but-set-variable")
0072 # define DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE \
0073 DIAGNOSTIC_IGNORE ("-Wunused-but-set-variable")
0074 # endif
0075
0076 # define DIAGNOSTIC_ERROR_SWITCH \
0077 DIAGNOSTIC_ERROR ("-Wswitch")
0078
0079 # if __has_warning ("-Wenum-constexpr-conversion")
0080 # define DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION \
0081 DIAGNOSTIC_IGNORE ("-Wenum-constexpr-conversion")
0082 # endif
0083
0084 #elif defined (__GNUC__)
0085
0086 # define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
0087 DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
0088
0089 # if __GNUC__ >= 7
0090 # define DIAGNOSTIC_IGNORE_REGISTER DIAGNOSTIC_IGNORE ("-Wregister")
0091 # endif
0092
0093 # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
0094 DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
0095
0096 # if __GNUC__ >= 11
0097 # define DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD \
0098 DIAGNOSTIC_IGNORE ("-Wstringop-overread")
0099 #endif
0100
0101 # define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
0102 DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
0103
0104 # if __GNUC__ >= 5
0105 # define DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE \
0106 DIAGNOSTIC_IGNORE ("-Wunused-but-set-variable")
0107 # endif
0108
0109 # if __GNUC__ >= 13
0110 # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
0111 # endif
0112
0113
0114
0115
0116 # if __GNUC__ >= 5
0117 # define DIAGNOSTIC_ERROR_SWITCH DIAGNOSTIC_ERROR ("-Wswitch")
0118 # endif
0119
0120 #endif
0121
0122 #ifndef DIAGNOSTIC_IGNORE_SELF_MOVE
0123 # define DIAGNOSTIC_IGNORE_SELF_MOVE
0124 #endif
0125
0126 #ifndef DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
0127 # define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
0128 #endif
0129
0130 #ifndef DIAGNOSTIC_IGNORE_REGISTER
0131 # define DIAGNOSTIC_IGNORE_REGISTER
0132 #endif
0133
0134 #ifndef DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
0135 # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
0136 #endif
0137
0138 #ifndef DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
0139 # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
0140 #endif
0141
0142 #ifndef DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
0143 # define DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
0144 #endif
0145
0146 #ifndef DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
0147 # define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
0148 #endif
0149
0150 #ifndef DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS
0151 # define DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS
0152 #endif
0153
0154 #ifndef DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE
0155 # define DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE
0156 #endif
0157
0158 #ifndef DIAGNOSTIC_ERROR_SWITCH
0159 # define DIAGNOSTIC_ERROR_SWITCH
0160 #endif
0161
0162 #ifndef DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION
0163 # define DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION
0164 #endif
0165
0166 #endif