Commit e7727a5b authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot

Merge topic 'cppcheck1.86'

7a95da77 Suppressed some more cppcheck warnings, fixed one
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Gobbi's avatarDavid Gobbi <david.gobbi@gmail.com>
Merge-request: !5031
parents 83f4b862 7a95da77
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
//========================================================================= //=========================================================================
// This file contains enough suppressions to result in no cppcheck warnings, // This file contains enough suppressions to result in no cppcheck warnings,
// at least on macOS with cppcheck 1.85 with the flags below. // at least on macOS with cppcheck 1.86 with the flags below.
// To run: // To run:
// cd /path/to/VTK/ // cd /path/to/VTK/
// cppcheck --platform=unspecified --enable=style -q --library=qt --library=posix --library=gnu --library=bsd --library=windows --suppressions-list=CMake/VTKcppcheckSuppressions.txt --template='{id},{file}:{line},{severity},{message}' -j8 -I Common/Core . // cppcheck --platform=unspecified --enable=style -q --library=qt --library=posix --library=gnu --library=bsd --library=windows --suppressions-list=CMake/VTKcppcheckSuppressions.txt --template='{id},{file}:{line},{severity},{message}' -j8 -I Common/Core .
// or // or
// cd /path/to/VTK-bin/ // cd /path/to/VTK-bin/
// cppcheck --project=compile_commands.json --platform=unspecified --enable=style -q --library=qt --library=posix --library=gnu --library=bsd --library=windows --suppressions-list=../VTK/CMake/VTKcppcheckSuppressions.txt --template='{id},{file}:{line},{severity},{message}' // cppcheck --project=compile_commands.json --platform=unspecified --enable=style -q --library=qt --library=posix --library=gnu --library=bsd --library=windows --suppressions-list=../VTK/CMake/VTKcppcheckSuppressions.txt --template='{id},{file}:{line},{severity},{message}' -j8
// Suppress everything from ThirdParty. // Suppress everything from ThirdParty.
*:ThirdParty/* *:ThirdParty/*
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*:Remote/WikiExamples/* *:Remote/WikiExamples/*
// If cppcheck itself crashes, well, that's its problem, ignore that. // If cppcheck itself crashes, well, that's its problem, ignore that.
// <https://>
cppcheckError cppcheckError
// When analyzing different define possibilities, it will sometimes hit a #error line // When analyzing different define possibilities, it will sometimes hit a #error line
...@@ -51,6 +50,9 @@ strtokCalled ...@@ -51,6 +50,9 @@ strtokCalled
// VTK assumes IEEE 754 floats, so this warning isn't useful. // VTK assumes IEEE 754 floats, so this warning isn't useful.
memsetClassFloat memsetClassFloat
// Gives too many false positives with << stream operator.
shiftNegative
// These are too stylistic // These are too stylistic
useStlAlgorithm useStlAlgorithm
...@@ -590,14 +592,21 @@ redundantAssignment:*/Testing/* ...@@ -590,14 +592,21 @@ redundantAssignment:*/Testing/*
// 13 warnings // 13 warnings
useInitializationList:* useInitializationList:*
// False positives. // False positive: Condition 'this->FileIndex<0' is always true
redundantAssignment:Wrapping/Tools/vtkParsePreprocess.c // <https://trac.cppcheck.net/ticket/8924>
knownConditionTrueFalse:IO/AMR/vtkAMRFlashReaderInternal.cxx
// False positive: <https://trac.cppcheck.net/ticket/8367> // False positive: Deallocation of an auto-variable results in undefined behaviour
CastIntegerToAddressAtReturn:Common/ExecutionModel/vtkAlgorithm.h // <https://trac.cppcheck.net/ticket/8923>
autovarInvalidDeallocation:Wrapping/Tools/vtkParseHierarchy.c
// False positive: struct member is never used. // False positive: Code 'C++ cast <...' is invalid C code
unusedStructMember:Common/Core/Testing/Cxx/TestArrayFreeFunctions.cxx // <https://trac.cppcheck.net/ticket/8925>
syntaxError:Rendering/OpenGL2/vtkCocoaGLView.mm
// Not technically a false positive, but there's no bug here and no clear way to rework the code in a good way
redundantAssignment:Wrapping/Tools/lex.yy.c
redundantAssignment:Wrapping/Tools/vtkParsePreprocess.c
// 4 warnings, should fix! // 4 warnings, should fix!
invalidPointerCast:Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.cxx invalidPointerCast:Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.cxx
......
...@@ -9,8 +9,8 @@ int main() ...@@ -9,8 +9,8 @@ int main()
{ {
/* Test whether getsockname takes socklen_t. */ /* Test whether getsockname takes socklen_t. */
struct sockaddr addr; struct sockaddr addr;
socklen_t length; socklen_t length = 0;
if(getsockname(0, &addr, (socklen_t*)&length)) return 0; if(getsockname(0, &addr, &length)) return 0;
if(sizeof (socklen_t)) return 0; if(sizeof (socklen_t)) return 0;
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment