@@ -94,62 +94,145 @@ CompileFlags:
94
94
-Wextra, # extra warnings
95
95
-Wpedantic,
96
96
97
+ -Wpointer-arith, # anything depends upon size of func or void
98
+ -Wcast-align, # pointer is cast such that required alignment of target is increased
99
+ -Wcast-qual, # pointer is cast to remove a type qualifier from target type
100
+ -Wbad-function-cast, # casting functions to incompatible types
101
+ -Wdiscarded-array-qualifiers, # qualifiers on arrays which are pointer targets are discarded
102
+ -Wdiscarded-qualifiers, # type qualifiers on pointers are discarded
103
+ # -Wint-to-pointer-cast, # cast to a pointer from an integer of a different size
104
+ # -Wpointer-compare, # pointer is compared with a zero character constant
105
+ # -Wpointer-sign, # a pointer differs in signedness in an assignment
106
+ # -Wpointer-to-int-cast, # a pointer is cast to an integer of a different size
107
+
108
+ -Winline, # inlined function cannot be inlined
109
+ -Wvla, # variable length arrays
110
+ -Wundef, # unitialized identifier evaluated in an #if
111
+ -Wmain, # suspicious declarations of "main"
112
+ -Wmaybe-uninitialized, # maybe uninitialized automatic variables
113
+ -Wuninitialized,
114
+ -Winvalid-offsetof, # invalid uses of the "offsetof" macro
115
+ -Wpragmas, # misuses of pragmas
116
+ -Wattributes, # inappropriate attribute usage
117
+ -Wampersand, # missing ampersand in continued character constants
118
+ -Wignored-attributes, # attributes are ignored
119
+ -Wignored-qualifiers, # type qualifiers are ignored
120
+
121
+ -Wconversion, # implicit conversions that may alter value
122
+ -Wconversion-extra, # most implicit conversions
123
+ -Wconversion-null, # converting NULL from/to a non-pointer type
124
+ -Wincompatible-pointer-types, # there is a conversion between pointers that have incompatible types
125
+ -Wint-conversion, # incompatible integer to pointer and pointer to integer conversions
126
+ -Wfloat-conversion, # implicit conversions causing loss of floating point precision
127
+ -Wdouble-promotion, # implicit conversions from "float" to "double"
128
+ -Wsign-conversion, # converting signed -> unsigned (vice versa)
129
+ -Wcharacter-truncation, # truncated character expressions
130
+ -Wwrite-strings, # string constants 'const'
131
+ -Wclobbered, # variables that might be changed by "longjmp" or "vfork"
132
+ -Wjump-misses-init, # a jump misses a variable initialization
133
+
134
+ -Wformat, # printf/scanf/strftime/strfmon format string anomalies
135
+ -Wformat-signedness, # sign differences with format functions
136
+ -Wformat-contains-nul, # format strings that contain NUL bytes
137
+ -Wformat-extra-args, # passing too many arguments to a function for its format string
138
+ -Wformat-truncation, # calls to snprintf and similar functions that truncate output
139
+ -Wformat-overflow, # format strings that write past the end of the dest
140
+ -Wformat-security, # possible security problems with format functions
141
+ # -Wformat-zero-length, # zero-length formats
142
+
143
+ -Wdeprecated, # deprecated compiler feature, class, method, or field is used
144
+ -Wdeprecated-declarations, # uses of __attribute__((deprecated)) declarations
145
+ -Wdesignated-init, # positional init of structs requiring designated initializer
146
+
97
147
-Wfloat-equal, # testing floats for equality
98
- -Wundef, # unitialized identifier evaluated in an #if
99
- -Wshadow, # variable shadows another
100
- -Wpointer-arith, # anything dpends upon size of func or void
101
- -Wcast-align, # pointer is cast such that required alignment of target is increased
102
- -Wcast-qual, # pointer is cast to remove a type qualifier from target type
103
- -Wbad-function-cast,
104
- -Wold-style-definition,
105
- -Wredundant-decls,
148
+ -Wcompare-reals, # warn about equality comparisons involving REAL or COMPLEX expressions
149
+ -Wenum-compare, # comparison of different enum types
150
+
151
+ -Waggregate-return, # funcs that return structs/unions are defined
152
+ -Wswitch-default, # switch statement does not have default
153
+ -Wswitch-enum, # switch statement has index of enum type last a case for an enumeration
154
+ -Wempty-body, # an empty body in an if or else statement
155
+ -Wduplicated-branches, # duplicated branches in if-else statements
156
+ -Wduplicated-cond, # duplicated conditions in an if-else-if chain
157
+ -Wimplicit, # implicit declarations
158
+ -Wimplicit-fallthrough, # a switch case falls through
159
+ -Wimplicit-function-declaration, # implicit function declarations
160
+ -Wimplicit-int, # a declaration does not specify a type
161
+ -Wimplicit-procedure, # called procedures not explicitly declared
162
+
163
+ -Wendif-labels, # stray tokens after #else and #endif
164
+ -Wexpansion-to-defined, # "defined" is used outside #if
165
+ -Wmisleading-indentation, # indentation does not reflect the block structure
166
+
167
+ # -Wframe-address, # __builtin_frame_address or __builtin_return_address is used unsafely
168
+ -Wfree-nonheap-object, # attempting to free a non-heap object
169
+ -Wdelete-incomplete, # deleting a pointer to incomplete type
170
+ -Wchkp, # memory access errors found by Pointer Bounds Checker
171
+ -Wrestrict, # argument passed to a restrict- qualified parameter aliases with another argument
172
+ -Waddress, # suspicious use of memory address
173
+ -Wreturn-local-addr, # returning a pointer/reference to a local or temporary variable
174
+ -Wmemset-elt-size, # suspicious memset where the third argument contains the num of elements
175
+ -Wmemset-transposed-args, # suspicious memset where the third argument is constant literal 0
176
+ -Walloc-zero, # for calls to allocation functions that specify zero bytes
177
+ -Winit-self, # variables which are initialized to themselves
178
+ -Wnull-dereference, # dereferencing a NULL pointer
179
+ -Wnonnull-compare, # comparing pointer parameter with nonnull attribute with NULL
180
+ # -Wnonnull, # NULL being passed to argument slots marked as requiring non-NULL
181
+
182
+ -Wparentheses, # possibly missing parentheses
183
+ -Waliasing, # possible aliasing of dummy args
184
+ -Wshadow, # variable shadows another
185
+ -Wshadow-ivar, # local declaration hides an instance variable
186
+ -Wintrinsic-shadow, # user-procedure has the same name as an intrinsic
187
+ -Wbuiltin-declaration-mismatch, # builtin function is declared with the wrong signature
188
+ -Wbuiltin-macro-redefined, # builtin preprocessor macro is undefined or redefined
189
+
190
+ -Wunreachable-code, # self explanatory
191
+ -Wnested-externs, # "extern" declarations not at file scope
192
+ -Winfinite-recursion,
193
+
106
194
-Wstrict-aliasing=2,
107
- -Wstrict-prototypes, # func declared/defined without specifying variables
108
195
-Wstrict-overflow=5,
109
- -Wwrite-strings, # string constants 'const'
110
- -Waggregate-return, # funcs that return structs/unions are defined
111
- -Wswitch-default, # switch statement does not have default
112
- -Wswitch-enum, # switch statement has index of enum type last a case for an enumeration
113
- -Wconversion, # implicit conversions that may alter value
114
- -Wsign-conversion,
115
- -Wunreachable-code, # self explanatory
116
- -Wnested-externs,
117
- -Wdisabled-optimization,
118
- -Winline,
119
- -Wformat,
120
- -Wformat-signedness,
121
- -Winit-self,
122
- # -Wpadded,
196
+ -Woverflow, # overflow in arithmetic expressions
197
+ -Wstringop-overflow, # buffer overflow in string
198
+ -Wshift-count-overflow, # shift count >= width of type
199
+ # -Wshift-count-negative, # shift count is negative
123
200
124
- -Wuninitialized,
125
- -Wlogical-op,
126
- -Wmissing-prototypes,
127
- -Wmissing-declarations,
128
- -Wvla, # variable length arrays
129
- -Waddress, # suspicious use of memory address
201
+ -Wstrict-prototypes, # func declared/defined without specifying variables
202
+ -Wmissing-prototypes, # global functions without prototypes
203
+ -Wmissing-declarations, # global functions without previous declarations
204
+ -Wduplicate-decl-specifier, # declaration has duplicate const, volatile, restrict or _Atomic spec
205
+ -Wmissing-include-dirs, # user-specified include directories that do not exist
206
+ -Wmissing-parameter-type, # function parameters declared without a type specifier in K&R-style
207
+ -Wold-style-cast, # a C-style cast is used in a program
208
+ -Wold-style-declaration, # obsolescent usage in a declaration
209
+ -Wold-style-definition, # an old-style parameter definition is used
210
+ -Wredundant-decls, # multiple declarations of the same object
211
+ # -Wdeclaration-after-statement, # declaration is found after a statement
212
+ # -Wmissing-field-initializers, # missing fields in struct initializers
130
213
131
- -Wbool-compare, # warn when comparing bool to integer
132
- -Wbool-operation, # warn about certain boolean ops
214
+ -Wlogical-op, # logical op suspiciously always evaluating to true or false
215
+ -Wbool-compare, # comparing bool to integer
216
+ -Wbool-operation, # certain boolean ops
217
+ -Wint-in-bool-context, # suspicious integer expressions in boolean context
133
218
134
- # -fsanitize=address,
135
- # -fsanitize=undefined,
136
- # -save-temps, # leave behind results of preprocess and assembly
219
+ -Wargument-mismatch, # type and rank mismatches between arguments and parameters
220
+ -Warray-bounds, # if an array is accessed out of bounds
221
+ -Warray-temporaries, # about creation of array temporaries
137
222
138
- # OPTIMIZE
139
- # -fconserve-stack, # don't optimize in a way that increases stack
140
- # -fstack-usage, # output stack usage on a per function basis
223
+ -Wdisabled-optimization, # optimization pass is disabled
224
+ # -Wpadded, # warn when padding is required to align structure members
225
+ # -Wpacked, # packed attribute has no effect on struct layout
226
+ # -Wpacked-bitfield-compat, # packed bit-fields whose offset changed in GCC 4.4
141
227
142
- # SAFE
143
- # -fno-strict-aliasing,
144
- # -fno-delete-null-pointer-checks,
145
- # -fwrapv, # assume signed arithmetic overflow wraps
228
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146
229
147
230
# Disable
148
- -Wno-unused,
231
+ -Wno-format-nonliteral, # format strings that are not literals
232
+ -Wno-unused, # unused
149
233
-Wno-unused-result,
150
234
-Wno-unused-variable,
151
235
-Wno-unused-function,
152
- # -Wno-format,
153
236
154
237
# GNU
155
238
# -fnested-functions, # allow nested functions
@@ -158,6 +241,44 @@ CompileFlags:
158
241
-Wno-gnu-empty-struct, # don't warn about empty struct
159
242
-Wno-gnu-binary-literal,
160
243
244
+ # -Wreorder, # the compiler reorders code
245
+ # -Wrealloc-lhs-all, # a left-hand-side variable is reallocated
246
+ # -Wrealloc-lhs, # a left-hand-side array variable is reallocated
247
+ # -Wregister, # uses of register storage specifier
248
+
249
+ # -Wlogical-not-parentheses, # logical not is used on the left hand side operand of a comparison
250
+ # -Wchar-subscripts, # about subscripts whose type is "char"
251
+ # -Wfunction-elimination, # function call elimination
252
+ # -Wframe-larger-than, # stack frame requires more than <number> bytes
253
+ # -Wlarger-than, # if an object is larger than <number> bytes
254
+ # -Wconditionally-supported, # conditionally-supported constructs
255
+
256
+ # -Wdiv-by-zero, # compile-time integer division by zero
257
+ # -Wfatal-errors, # exit on the first error occurred
258
+
259
+ # -Wnormalized, # non-normalised Unicode strings
260
+ # -Woverlength-strings, # string is longer than the maximum portable length specified by the standard
261
+ # -Woverloaded-virtual, # overloaded virtual function names
262
+ # -Wline-truncation, # truncated source lines
263
+ # -Winteger-division, # constant integer divisions with truncated results
264
+ # -Wintrinsics-std, # on intrinsics not part of the selected standard
265
+ # -Winvalid-memory-model, # an atomic memory model parameter is known to be outside the valid range
266
+
267
+ # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
268
+
269
+ # -fsanitize=address,
270
+ # -fsanitize=undefined,
271
+ # -save-temps, # leave behind results of preprocess and assembly
272
+
273
+ # OPTIMIZE
274
+ # -fconserve-stack, # don't optimize in a way that increases stack
275
+ # -fstack-usage, # output stack usage on a per function basis
276
+
277
+ # SAFE
278
+ # -fno-strict-aliasing,
279
+ # -fno-delete-null-pointer-checks,
280
+ # -fwrapv, # assume signed arithmetic overflow wraps
281
+
161
282
# Use of non-standard escape character '\e' [clang -Wpedantic]
162
283
]
163
284
Remove : []
0 commit comments