|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<RuleSet Name="DefaultRules" ToolsVersion="15.0"> |
| 2 | +<RuleSet Name="DefaultRules" ToolsVersion="17.0"> |
3 | 3 | <Include Path="allrules.ruleset" Action="Default" /> |
4 | 4 | <Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native"> |
5 | 5 | <Rule Id="C26100" Action="Error" /> |
|
12 | 12 | <Rule Id="C26116" Action="Error" /> |
13 | 13 | <Rule Id="C26117" Action="Error" /> |
14 | 14 | <Rule Id="C26130" Action="Error" /> |
15 | | - <Rule Id="C26135" Action="Error" /> |
| 15 | + <Rule Id="C26135" Action="None" /> <!-- Missing annotation <annotation> at function '<func>' --> |
16 | 16 | <Rule Id="C26140" Action="Error" /> |
17 | | - <Rule Id="C26160" Action="Error" /> |
| 17 | + <Rule Id="C26160" Action="None" /> <!-- Caller possibly failing to hold lock '<lock>' before calling function '<func>'. --> |
18 | 18 | <Rule Id="C26165" Action="Error" /> |
19 | 19 | <Rule Id="C26166" Action="Error" /> |
20 | 20 | <Rule Id="C26167" Action="Error" /> |
21 | | - <Rule Id="C26400" Action="Error" /> |
22 | | - <Rule Id="C26401" Action="Error" /> |
| 21 | + <Rule Id="C26400" Action="None" /> <!-- Do not assign the result of an allocation or a function call with an owner<T> return value to a raw pointer --> |
| 22 | + <Rule Id="C26401" Action="None" /> <!-- Do not delete a raw pointer that is not an owner<T> --> |
23 | 23 | <Rule Id="C26402" Action="Error" /> |
24 | 24 | <Rule Id="C26403" Action="Error" /> |
25 | 25 | <Rule Id="C26404" Action="Error" /> |
26 | 26 | <Rule Id="C26405" Action="Error" /> |
27 | 27 | <Rule Id="C26406" Action="Error" /> |
28 | 28 | <Rule Id="C26407" Action="Error" /> |
29 | 29 | <Rule Id="C26408" Action="Error" /> |
30 | | - <Rule Id="C26409" Action="Error" /> |
| 30 | + <Rule Id="C26409" Action="None" /> <!-- Avoid calling new and delete explicitly, use std::make_unique<T> instead --> |
31 | 31 | <Rule Id="C26410" Action="Error" /> |
32 | 32 | <Rule Id="C26411" Action="Error" /> |
33 | | - <Rule Id="C26414" Action="Error" /> |
34 | | - <Rule Id="C26415" Action="Error" /> |
| 33 | + <Rule Id="C26414" Action="None" /> <!-- Move, copy, reassign or reset a local smart pointer. --> |
| 34 | + <Rule Id="C26415" Action="None" /> <!-- Smart pointer parameter is used only to access contained pointer. Use T* or T& instead. --> |
35 | 35 | <Rule Id="C26416" Action="Error" /> |
36 | 36 | <Rule Id="C26417" Action="Error" /> |
37 | | - <Rule Id="C26418" Action="Error" /> |
| 37 | + <Rule Id="C26418" Action="None" /> <!-- Shared pointer parameter is not copied or moved. Use T* or T& instead. --> |
38 | 38 | <Rule Id="C26426" Action="Error" /> |
39 | 39 | <Rule Id="C26427" Action="Error" /> |
40 | | - <Rule Id="C26429" Action="None" /> |
41 | | - <Rule Id="C26430" Action="Error" /> |
| 40 | + <Rule Id="C26429" Action="None" /> <!-- Symbol is never tested for nullness, it can be marked as gsl::not_null. --> |
| 41 | + <Rule Id="C26430" Action="None" /> <!-- Symbol '<var>' is not tested for nullness on all paths --> |
42 | 42 | <Rule Id="C26431" Action="Error" /> |
43 | | - <Rule Id="C26432" Action="None" /> |
44 | | - <Rule Id="C26433" Action="Error" /> |
45 | | - <Rule Id="C26434" Action="Error" /> |
| 43 | + <Rule Id="C26432" Action="None" /> <!-- If you define or delete any default operation in the type 'type-name', define or delete them all --> |
| 44 | + <Rule Id="C26433" Action="None" /> <!-- Function should be marked with override --> |
| 45 | + <Rule Id="C26434" Action="None" /> <!-- Function 'derived::function' hides a non-virtual function 'base::function' --> |
46 | 46 | <Rule Id="C26435" Action="Error" /> |
47 | | - <Rule Id="C26436" Action="Error" /> |
| 47 | + <Rule Id="C26436" Action="None" /> <!-- The type 'symbol' with a virtual function needs either public virtual or protected non-virtual destructor --> |
48 | 48 | <Rule Id="C26437" Action="Error" /> |
49 | | - <Rule Id="C26438" Action="Error" /> |
| 49 | + <Rule Id="C26438" Action="None" /> <!-- Avoid goto --> |
50 | 50 | <Rule Id="C26439" Action="Error" /> |
51 | | - <Rule Id="C26440" Action="Error" /> |
| 51 | + <Rule Id="C26440" Action="None" /> <!-- Function can be declared 'noexcept'. --> |
52 | 52 | <Rule Id="C26441" Action="Error" /> |
53 | 53 | <Rule Id="C26443" Action="Error" /> |
54 | 54 | <Rule Id="C26444" Action="Error" /> |
55 | 55 | <Rule Id="C26445" Action="Error" /> |
56 | | - <Rule Id="C26446" Action="None" /> |
57 | | - <Rule Id="C26447" Action="Error" /> |
58 | | - <Rule Id="C26448" Action="None" /> |
| 56 | + <Rule Id="C26446" Action="None" /> <!-- Prefer to use gsl::at() instead of unchecked subscript operator --> |
| 57 | + <Rule Id="C26447" Action="None" /> <!-- The function is declared noexcept but calls function function_name that may throw exceptions --> |
| 58 | + <Rule Id="C26448" Action="None" /> <!-- Consider using gsl::finally if final action is intended --> |
59 | 59 | <Rule Id="C26449" Action="Error" /> |
60 | 60 | <Rule Id="C26450" Action="Error" /> |
61 | | - <Rule Id="C26451" Action="Error" /> |
| 61 | + <Rule Id="C26451" Action="None" /> <!-- Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow --> |
62 | 62 | <Rule Id="C26452" Action="Error" /> |
63 | 63 | <Rule Id="C26453" Action="Error" /> |
64 | 64 | <Rule Id="C26454" Action="Error" /> |
| 65 | + <Rule Id="C26455" Action="None" /> <!-- Default constructor should not throw. Declare it 'noexcept' --> |
| 66 | + <Rule Id="C26457" Action="None" /> <!-- (void) should not be used to ignore return values, use 'std::ignore =' instead --> |
65 | 67 | <Rule Id="C26459" Action="Error" /> |
66 | | - <Rule Id="C26460" Action="Error" /> |
67 | | - <Rule Id="C26461" Action="Error" /> |
68 | | - <Rule Id="C26462" Action="Error" /> |
| 68 | + <Rule Id="C26460" Action="None" /> <!-- The reference argument 'argument' for function 'function' can be marked as const --> |
| 69 | + <Rule Id="C26461" Action="None" /> <!-- The pointer argument 'argument' for function 'function' can be marked as a pointer to const --> |
| 70 | + <Rule Id="C26462" Action="None" /> <!-- The value pointed to by '<var>' is assigned only once, mark it as a pointer to const --> |
69 | 71 | <Rule Id="C26463" Action="Error" /> |
70 | 72 | <Rule Id="C26464" Action="Error" /> |
71 | 73 | <Rule Id="C26465" Action="Error" /> |
72 | 74 | <Rule Id="C26466" Action="Error" /> |
73 | | - <Rule Id="C26471" Action="Error" /> |
74 | | - <Rule Id="C26472" Action="None" /> |
75 | | - <Rule Id="C26473" Action="Error" /> |
76 | | - <Rule Id="C26474" Action="Error" /> |
| 75 | + <Rule Id="C26467" Action="None" /> <!-- Converting from floating point to unsigned integral types results in non-portable code if the double/float has a negative value. --> |
| 76 | + <Rule Id="C26471" Action="None" /> <!-- Don't use reinterpret_cast. A cast from void* can use static_cast --> |
| 77 | + <Rule Id="C26472" Action="None" /> <!-- Don't use a static_cast for arithmetic conversions. Use brace initialization, gsl::narrow_cast, or gsl::narrow. --> |
| 78 | + <Rule Id="C26473" Action="None" /> <!-- Don't cast between pointer types where the source type and the target type are the same --> |
| 79 | + <Rule Id="C26474" Action="None" /> <!-- Use implicit conversion --> |
77 | 80 | <Rule Id="C26475" Action="Error" /> |
78 | | - <Rule Id="C26476" Action="Error" /> |
| 81 | + <Rule Id="C26476" Action="None" /> <!-- Expression/symbol 'name' uses a naked union 'union' with multiple type pointers: Use variant instead --> |
79 | 82 | <Rule Id="C26477" Action="Error" /> |
80 | | - <Rule Id="C26481" Action="Error" /> |
81 | | - <Rule Id="C26482" Action="Error" /> |
| 83 | + <Rule Id="C26478" Action="None" /> <!-- Don't use std::move on constant variables. --> |
| 84 | + <Rule Id="C26481" Action="None" /> <!-- Don't use pointer arithmetic. Use span instead --> |
| 85 | + <Rule Id="C26482" Action="None" /> <!-- Only index into arrays using constant expressions. --> |
82 | 86 | <Rule Id="C26483" Action="Error" /> |
83 | | - <Rule Id="C26485" Action="Error" /> |
84 | | - <Rule Id="C26486" Action="None" /> |
85 | | - <Rule Id="C26487" Action="Error" /> |
86 | | - <Rule Id="C26489" Action="None" /> |
87 | | - <Rule Id="C26490" Action="Error" /> |
| 87 | + <Rule Id="C26485" Action="None" /> <!-- Expression 'array-name': No array to pointer decay --> |
| 88 | + <Rule Id="C26486" Action="None" /> <!-- Don't pass a pointer that may be invalid (dangling) as a parameter to a function. --> |
| 89 | + <Rule Id="C26487" Action="None" /> <!-- Don't allow a function to return an invalid pointer, either through a formal return statement or through output parameters. --> |
| 90 | + <Rule Id="C26489" Action="None" /> <!-- Don't dereference a pointer that may be invalid. --> |
| 91 | + <Rule Id="C26490" Action="None" /> <!-- Don't use reinterpret_cast. --> |
88 | 92 | <Rule Id="C26491" Action="Error" /> |
89 | | - <Rule Id="C26492" Action="Error" /> |
90 | | - <Rule Id="C26493" Action="Error" /> |
91 | | - <Rule Id="C26494" Action="Error" /> |
92 | | - <Rule Id="C26495" Action="Error" /> |
93 | | - <Rule Id="C26496" Action="Error" /> |
94 | | - <Rule Id="C26497" Action="Error" /> |
| 93 | + <Rule Id="C26492" Action="None" /> <!-- Don't use const_cast to cast away const. --> |
| 94 | + <Rule Id="C26493" Action="None" /> <!-- Don't use C-style casts. --> |
| 95 | + <Rule Id="C26494" Action="None" /> <!-- Variable 'variable' is uninitialized. Always initialize an object. --> |
| 96 | + <Rule Id="C26495" Action="None" /> <!-- Variable 'variable' is uninitialized. Always initialize a member variable --> |
| 97 | + <Rule Id="C26496" Action="None" /> <!-- The variable 'variable' is assigned only once, mark it as const. --> |
| 98 | + <Rule Id="C26497" Action="None" /> <!-- Attempt to make this constexpr --> |
95 | 99 | <Rule Id="C26498" Action="Error" /> |
96 | | - <Rule Id="C28020" Action="Error" /> |
| 100 | + <Rule Id="C26814" Action="None" /> <!-- The const variable 'variable' can be computed at compile time. Consider using constexpr --> |
| 101 | + <Rule Id="C26818" Action="None" /> <!-- Switch statement does not cover all cases. Consider adding a 'default' label --> |
| 102 | + <Rule Id="C26819" Action="None" /> <!-- Unannotated fallthrough --> |
| 103 | + <Rule Id="C26826" Action="None" /> <!-- Don't use C-style variable arguments --> |
| 104 | + <Rule Id="C26859" Action="None" /> <!-- Empty optional '<var>' is unwrapped, will throw exception. --> |
| 105 | + <Rule Id="C28020" Action="None" /> <!-- The expression 'expr' is not true at this call --> |
97 | 106 | <Rule Id="C28021" Action="Error" /> |
98 | 107 | <Rule Id="C28022" Action="Error" /> |
99 | 108 | <Rule Id="C28023" Action="Error" /> |
|
142 | 151 | <Rule Id="C28156" Action="Error" /> |
143 | 152 | <Rule Id="C28157" Action="Error" /> |
144 | 153 | <Rule Id="C28158" Action="Error" /> |
145 | | - <Rule Id="C28159" Action="Error" /> |
| 154 | + <Rule Id="C28159" Action="None" /> <!-- Consider using *function_name_1* instead of *function_name_2*. --> |
146 | 155 | <Rule Id="C28160" Action="Error" /> |
147 | 156 | <Rule Id="C28161" Action="Error" /> |
148 | 157 | <Rule Id="C28162" Action="Error" /> |
|
213 | 222 | <Rule Id="C28245" Action="Error" /> |
214 | 223 | <Rule Id="C28246" Action="Error" /> |
215 | 224 | <Rule Id="C28250" Action="Error" /> |
216 | | - <Rule Id="C28251" Action="Error" /> |
217 | | - <Rule Id="C28252" Action="Error" /> |
218 | | - <Rule Id="C28253" Action="Error" /> |
| 225 | + <Rule Id="C28251" Action="None" /> <!-- Inconsistent annotation for function: this instance has an error --> |
| 226 | + <Rule Id="C28252" Action="None" /> <!-- Inconsistent annotation for '<func>': <param> has '<annotation>' on the prior instance. --> |
| 227 | + <Rule Id="C28253" Action="None" /> <!-- Inconsistent annotation for '<func>': <param> has '<annotations>' on this instance --> |
219 | 228 | <Rule Id="C28254" Action="Error" /> |
220 | 229 | <Rule Id="C28260" Action="Error" /> |
221 | 230 | <Rule Id="C28262" Action="Error" /> |
|
239 | 248 | <Rule Id="C28290" Action="Error" /> |
240 | 249 | <Rule Id="C28291" Action="Error" /> |
241 | 250 | <Rule Id="C28300" Action="Error" /> |
242 | | - <Rule Id="C28301" Action="Error" /> |
| 251 | + <Rule Id="C28301" Action="None" /> <!-- No annotations for first declaration --> |
243 | 252 | <Rule Id="C28302" Action="Error" /> |
244 | 253 | <Rule Id="C28303" Action="Error" /> |
245 | 254 | <Rule Id="C28304" Action="Error" /> |
|
282 | 291 | <Rule Id="C28736" Action="Error" /> |
283 | 292 | <Rule Id="C28750" Action="Error" /> |
284 | 293 | <Rule Id="C28751" Action="Error" /> |
285 | | - <Rule Id="C6001" Action="Error" /> |
286 | | - <Rule Id="C6011" Action="Error" /> |
| 294 | + <Rule Id="C6001" Action="None" /> <!-- uninitialized memory --> |
| 295 | + <Rule Id="C6011" Action="None" /> <!-- Possible null deref --> |
287 | 296 | <Rule Id="C6014" Action="Error" /> |
288 | 297 | <Rule Id="C6029" Action="Error" /> |
289 | | - <Rule Id="C6031" Action="Error" /> |
| 298 | + <Rule Id="C6031" Action="None" /> <!-- Return value ignored: '<func>'. --> |
290 | 299 | <Rule Id="C6053" Action="Error" /> |
291 | | - <Rule Id="C6054" Action="Error" /> |
| 300 | + <Rule Id="C6054" Action="None" /> <!-- String '<var>' might not be zero-terminated. --> |
292 | 301 | <Rule Id="C6059" Action="Error" /> |
293 | 302 | <Rule Id="C6063" Action="Error" /> |
294 | 303 | <Rule Id="C6064" Action="Error" /> |
295 | 304 | <Rule Id="C6066" Action="Error" /> |
296 | 305 | <Rule Id="C6067" Action="Error" /> |
297 | | - <Rule Id="C6101" Action="Error" /> |
| 306 | + <Rule Id="C6101" Action="None" /> <!-- Returning uninitialized memory --> |
298 | 307 | <Rule Id="C6200" Action="Error" /> |
299 | 308 | <Rule Id="C6201" Action="Error" /> |
300 | 309 | <Rule Id="C6211" Action="Error" /> |
|
319 | 328 | <Rule Id="C6248" Action="Error" /> |
320 | 329 | <Rule Id="C6250" Action="Error" /> |
321 | 330 | <Rule Id="C6255" Action="Error" /> |
322 | | - <Rule Id="C6258" Action="Error" /> |
| 331 | + <Rule Id="C6258" Action="None" /> <!-- Using TerminateThread does not allow proper thread clean up. --> |
323 | 332 | <Rule Id="C6259" Action="Error" /> |
324 | 333 | <Rule Id="C6260" Action="Error" /> |
325 | 334 | <Rule Id="C6262" Action="Error" /> |
|
338 | 347 | <Rule Id="C6280" Action="Error" /> |
339 | 348 | <Rule Id="C6281" Action="Error" /> |
340 | 349 | <Rule Id="C6282" Action="Error" /> |
341 | | - <Rule Id="C6283" Action="Error" /> |
| 350 | + <Rule Id="C6283" Action="None" /> <!-- array new with scalar delete --> |
342 | 351 | <Rule Id="C6284" Action="Error" /> |
343 | 352 | <Rule Id="C6285" Action="Error" /> |
344 | 353 | <Rule Id="C6286" Action="Error" /> |
|
383 | 392 | <Rule Id="C6334" Action="Error" /> |
384 | 393 | <Rule Id="C6335" Action="Error" /> |
385 | 394 | <Rule Id="C6336" Action="Error" /> |
386 | | - <Rule Id="C6340" Action="Error" /> |
| 395 | + <Rule Id="C6340" Action="None" /> <!-- sign mismatch --> |
387 | 396 | <Rule Id="C6381" Action="Error" /> |
388 | 397 | <Rule Id="C6383" Action="Error" /> |
389 | 398 | <Rule Id="C6384" Action="Error" /> |
390 | | - <Rule Id="C6385" Action="Error" /> |
391 | | - <Rule Id="C6386" Action="Error" /> |
392 | | - <Rule Id="C6387" Action="Error" /> |
393 | | - <Rule Id="C6388" Action="Error" /> |
| 399 | + <Rule Id="C6385" Action="None" /> <!-- Reading invalid data --> |
| 400 | + <Rule Id="C6386" Action="None" /> <!-- Overrun --> |
| 401 | + <Rule Id="C6387" Action="None" /> <!-- '<expr>' could be '<val>': this does not adhere to the specification for the function '<func>' --> |
| 402 | + <Rule Id="C6388" Action="None" /> <!-- '<var>' might not be '<val>': this does not adhere to the specification for the function '<func>' --> |
394 | 403 | <Rule Id="C6400" Action="Error" /> |
395 | 404 | <Rule Id="C6401" Action="Error" /> |
396 | 405 | <Rule Id="C6411" Action="Error" /> |
|
418 | 427 | <Rule Id="C6540" Action="Error" /> |
419 | 428 | <Rule Id="C6551" Action="Error" /> |
420 | 429 | <Rule Id="C6552" Action="Error" /> |
| 430 | + <Rule Id="C6553" Action="None" /> <!-- Annotation does not apply to a value type --> |
421 | 431 | <Rule Id="C6701" Action="Error" /> |
422 | 432 | <Rule Id="C6702" Action="Error" /> |
423 | 433 | <Rule Id="C6703" Action="Error" /> |
|
0 commit comments