最多的代码错误
Posted likemao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了最多的代码错误相关的知识,希望对你有一定的参考价值。
1.pvs_studio_V730
msg="Not all members of a class are initialized inside the constructor. Consider inspecting: createdDateTime, modifiedDateTime."
2.pvs_studio_V595
msg="The ‘browser‘ pointer was utilized before it was verified against nullptr. Check lines: 280, 283."
3.pvs_studio_V721
msg="The VARIANT_BOOL type is utilized incorrectly. The true value (VARIANT_TRUE) is defined as -1. Check: ((& isPreview)->boolVal) = m_isPreview."
4.pvs_studio_V811
msg="Decreased performance. Excessive type casting: string -> char * -> string. Consider inspecting first argument of the function fileExists."
5.pvs_studio_V547
msg="Expression ‘j >= 0‘ is always true. Unsigned type value is always >= 0."
6.pvs_studio_V716
msg="Suspicious type conversion in assign expression: ‘BOOL = HRESULT‘."
7.pvs_studio_V745
msg="A ‘wchar_t *‘ type string is incorrectly converted to ‘BSTR‘ type string. Consider using ‘SysAllocString‘ function."
8.pvs_studio_V746
msg="Type slicing. An exception should be caught by reference rather than by value."
9.pvs_studio_V724
msg="Converting type ‘int‘ to type ‘VARIANT_BOOL‘ can lead to a loss of high-order bits. Non-zero value can become ‘FALSE‘."
10.pvs_studio_V814
msg="Decreased performance. Calls to the ‘wcslen‘ function have being made multiple times when a condition for the loop‘s continuation was calculated."
11.pvs_studio_V575
msg="The null pointer is passed into ‘memcpy‘ function. Inspect the second argument."
12.pvs_studio_V501
msg="There are identical sub-expressions to the left and to the right of the ‘!=‘ operator: m_fitMode != m_fitMode"
13.pvs_studio_V512
msg="A call of the ‘memset‘ function will lead to underflow of the buffer ‘lpszHeadInfo‘."
14.pvs_studio_V523
msg="The ‘then‘ statement is equivalent to the ‘else‘ statement."
15.pvs_studio_V567
msg="Undefined behavior. The ‘m_pixmapIndex‘ variable is modified while being used twice between sequence points."
16.pvs_studio_V570
msg="The ‘height‘ variable is assigned to itself."
17.pvs_studio_V576
msg="Incorrect format. Consider checking the third actual argument of the ‘wsprintfW‘ function. To print the value of pointer the ‘%p‘ should be used."
18.pvs_studio_V704
msg=‘this == nullptr‘ expression should be avoided - this expression is always false on newer compilers, because ‘this‘ pointer can never be NULL.
19.pvs_studio_V763
msg="Parameter ‘handle‘ is always rewritten in function body before being used."
20.pvs_studio_V510
msg="The ‘Format‘ function is not expected to receive class-type variable as second actual argument."
21.pvs_studio_V522
msg="Dereferencing of the null pointer ‘pTask‘ might take place. Check the logical condition."
22.pvs_studio_V599
msg="The destructor was not declared as a virtual one, although the ‘KAutoSaveItem‘ class contains virtual functions."
23.pvs_studio_V607
msg="Ownerless expression ‘Download_Fail‘.
24.pvs_studio_V672
msg="There is probably no need in creating the new ‘context‘ variable here. One of the function‘s arguments possesses the same name and this argument is a reference.
25.pvs_studio_V517
msg="The use of ‘if (A) {...} else if (A) {...}‘ pattern was detected. There is a probability of logical error presence. Check lines: 47, 59."
26.pvs_studio_V561
msg="It‘s probably better to assign value to ‘hr‘ variable than to declare it anew. Previous declaration: kolfontqhbcommand.cpp, line 343."
27.pvs_studio_V571
msg="Recurring check. The ‘if (!layout)‘ condition was already verified in line 1032
28.pvs_studio_V611
msg="The memory was allocated using ‘new T[]‘ operator but was released using the ‘delete‘ operator. Consider inspecting this code. It‘s probably better to use ‘delete [] buffer;‘.
29.pvs_studio_V674
msg="The literal ‘10.5‘ of ‘double‘ type is being implicitly cast to ‘int‘ type while calling the ‘setPointSize‘ function. Inspect the first argument."
30.pvs_studio_V541
msg="It is dangerous to print the string ‘strParam‘ into itself."
31.pvs_studio_V542
msg="Consider inspecting an odd type cast: ‘unsigned short‘ to ‘wchar_t *‘."
32.pvs_studio_V629
msg="Consider inspecting the ‘0x1 << (- * pStateBase[curState])‘ expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type."
33.pvs_studio_V521
msg="Such expressions using the ‘,‘ operator are dangerous. Make sure the expression is correct."
34.pvs_studio_V554
msg="Incorrect use of unique_ptr. The memory allocated with ‘new []‘ will be cleaned using ‘delete‘."
35.pvs_studio_V734
msg="An excessive check. Examine the conditions containing search for the substrings "*.dot" and "*.dotm"."
36.pvs_studio_V528
msg="It is odd that pointer to ‘wchar_t‘ type is compared with the L‘ ‘ value. Probably meant: *pPath == L‘ ‘."
37.pvs_studio_V590
msg="Consider inspecting the ‘lResult == 0L && lResult != 234L‘ expression. The expression is excessive or contains a misprint."
38.pvs_studio_V617
msg="Consider inspecting the condition. The ‘SizeY_FitContent‘ argument of the ‘|‘ bitwise operation contains a non-zero value."
39.pvs_studio_V712
msg="Be advised that compiler may delete this cycle or make it infinity. Use volatile variable(s) or synchronization primitives to avoid this."
40.pvs_studio_V502
msg="Perhaps the ‘?:‘ operator works in a different way than it was expected. The ‘?:‘ operator has a lower priority than the ‘==‘ operator."
41.pvs_studio_V557
msg="Array overrun is possible. The ‘16‘ index is pointing beyond array bound."
42.pvs_studio_V625
msg="Consider inspecting the ‘for‘ operator. Initial and final values of the iterator are the same."
43.pvs_studio_V682
msg="Suspicious literal is present: ‘/0‘. It is possible that a backslash should be used here instead: ‘ ‘."
44.pvs_studio_V766
msg="An item with the same key ‘L"secretKey"‘ has already been added."
45.pvs_studio_V767
msg="Suspicious access to element of ‘fileList‘ array by a constant index inside a loop.
以上是关于最多的代码错误的主要内容,如果未能解决你的问题,请参考以下文章