Skip to content

Instantly share code, notes, and snippets.

@mgaudet
Created November 10, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgaudet/91cff155b5f370b6c915bcf4025aefac to your computer and use it in GitHub Desktop.
Save mgaudet/91cff155b5f370b6c915bcf4025aefac to your computer and use it in GitHub Desktop.
Summary of PVS Studio errors and warning on the OMR project from https://github.com/eclipse/omr/issues/413
Errors: 321
Error code : Number of errors : Summary of error : Additional info
V730 : 111 : Not all members of a class are initialized inside the constructor : Mostly in compiler and gc
V595 : 48 : Pointer was utilized before it was verified against nullptr
V614 : 13 : Potentially uninitialized variable used : Mostly in compiler/ilgen
V542 : 13 : odd type cast: 'short' to 'unsigned char *' : compiler/x/codegen
V522 : 13 : Dereferencing of the null pointer might take place : Mostly in compiler/optimizer
V575 : 12 : Null pointer passed into function : port and /thread (unix)
V501 : 12 : Identical sub-expressions to the left and right of an operator
V576 : 10 : Incorrect format used in printf : In compiler and jitbuilder
V523 : 10 : The 'then' statement is equivalent to the 'else' statement
V598 : 9 : 'memcpy' is used to copy fields of RealRegister class. Virtual table pointer damaged : Mostly in compiler/x/codegen/OMRMachine.cpp
V629 : 8 : Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type.
V547 : 8 : Expression is either always false or always true
V678 : 5 : An object is used as an argument to its own method : setAssignedRegister function in compiler/x/codegen/OMRMachine.cpp, and setRangeHead function in gc
V561 : 5 : It's probably better to assign value to a pertivular variable than to declare it anew
V510 : 5 : A function is not expected to receive class-type variable as nth actual argument : See the error file
V610 : 4 : Undefined behavior. Check the shift operator '<<'. The left operand is negative : compiler/x/codegen
V621 : 3 : Consider inspecting the 'for' operator. Loop might be executed incorrectly
V548 : 3 : Consider reviewing type casting. TYPE X[][] in not equivalent to TYPE **X
V670 : 2 : Wrong order of initialization : compiler/env/Region.cpp
V637 : 2 : Two opposite conditions were encountered. The second condition is always false : OMRSimplifierHandlers.cpp and VPConstraint.cpp
V567 : 2 : Undefined behavior. 'i' is modified while being used twice between sequence points : OMRNode.cpp and VPHandlers.cpp
V562 : 2 : It's odd to compare a bool type value with a value of 0 : fvtest/porttest/testProcessHelpers.cpp
V530 : 2 : The return value of function 'strtoull' is required to be utilized : port/linux/omrosdump_helpers.c
V512 : 2 : Call to function leads to buffer overflow : compiler/x/codegen/X86Debug.cpp and /omrtrace/omrtracelog.cpp
V724 : 1 : Converting type 'uintptr_t' to type 'BOOLEAN' can lead to a loss of high-order bits. : fvtest/algotest/hashtabletest.c
V704 : 1 : '!this ||!other' should be avoided: 'this' pointer can never be NULL on new compilers : compiler/optimizer/VPConstraint.cpp
V654 : 1 : The condition '((BOOLEAN)(!((BOOLEAN) 0)))' of loop is always true : port/linux/omrvmem.c
V640 : 1 : Two lines in one : /compiler/compile/OSRData.cpp
V597 : 1 : Possible unwanted flushing of 'buf' : compiler/il/OMRNode.cpp
V591 : 1 : Non-void function should return a value : compiler/env/TRMemory.hpp
V583 : 1 : Wrong usage of ? operator : compiler/optimizer/OMRSimplifierHandlers.cpp (11045)
V571 : 1 : Same condition being checked in multiple if statements : compiler/optimizer/LoopVersioner.cpp
V568 : 1 : It's odd that the argument of sizeof() operator is 'ifNode->getConstValue()' : compiler/optimizer/TrivialDeadBlockRemover.cpp
V563 : 1 : Else branch could apply to previous if statement. There is ambiguity : compiler/x/codegen/X86Debug.cpp
V546 : 1 : Member of a class initialized by itself : compiler/optimizer/RegisterCandidate.hpp
V536 : 1 : Constant is represented using octal form : fvtest/porttest/testProcessHelpers.cpp
V517 : 1 : if(a) else if (a) pattern. But code looks fine to me : compiler/ras/Tree.cpp
V503 : 1 : pointer >= 0 comparison. File doesn't exist here : compiler/infra/CfgFrequencyCompletion.cpp
V002 : 1 : Ignore : Ignore
-----------------------------------------------------------------------
Warnings: 284
Error code : Number of errors : Summary of error : Additional info
V730 : 86 : Not all members of a class are initialized inside the constructor
V560 : 42 : Part of a conditional expression is always false or always true : Mostly in optimizer
V648 : 28 : Priority of operators can cause confusion. Use parenthesis : Mostly in optimizer
V581 : 17 : Same condition used in consecutive if operators
V690 : 16 : Class implements the '=' operator but lacks a copy constructor or vice-versa. Dangerous
V506 : 16 : Pointer to a local variable is stored outside the scope of this variable
V519 : 12 : A variable is assigned values twice consecutively
V678 : 9 : An object is used as an argument to its own method
V703 : 7 : A field in the derived class overrides a field in the base class
V591 : 6 : Non-void function should return a value
V592 : 5 : Expression enclosed by parenthesis twice
V728 : 4 : if condition check can be simplified
V640 : 4 : Bad indenting for if statements. Can lead to confusion : In optimizer
V612 : 4 : Unconditional return in a loop
V559 : 4 : An assignment is made in the conditional section of 'while'. RED FLAG : compiler/il/Aliases.cpp and OMRSymbolReferenceTable.cpp
V614 : 3 : Potentially uninitialized variable used : compiler/optimizer/VPHandlers.cpp
V547 : 3 : Expression is always true
V701 : 2 : Possible leak in realloc() : fvtest/rastest/traceRecordHelpers.cpp
V666 : 2 : Inspect 5th argument of function omrstr_set_token_from_buf : port/common/omrstr.c
V645 : 2 : Improper use of strncat. Could lead to buffer overflow : fvtest/porttest/omrdumpTest.cpp
V571 : 2 : A condition was already verified earlier. Redundant check
V764 : 1 : Possible incorrect order of arguments passed : compiler/optimizer/OMRSimplifierHandlers.cpp
V763 : 1 : Parameter 'storeLhsContainsCall' is always overwritten before being used : compiler/optimizer/LocalAnalysis.cpp
V681 : 1 : Ambiguous order of arguments in cloneBlocks. See error message : compiler/optimizer/VirtualGuardHeadMerger.cpp
V668 : 1 : No need to check pointer that was just allocated using new : compiler/control/OptimizationPlan.hpp
V649 : 1 : The same if statement exists twice : compiler/infra/BitVector.hpp
V636 : 1 : Implicit cast from size_t to float. Consider using explicit cast : gc/base/segregated/RegionPoolSegregated.cpp
V605 : 1 : Check flag POLL_RETRY_INTERVAL : port/unix/omrintrospect.c
V555 : 1 : The expression of the 'A - B > 0' kind will work as 'A != B' : compiler/optimizer/LoadExtensions.cpp
V536 : 1 : Octal form is used for a constant : port/linux/omrosdump_helpers.c
V524 : 1 : Some functions in header have same body : compiler/control/OMROptions.hpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment