diff --git a/Control/CxxUtils/CxxUtils/Array.icc b/Control/CxxUtils/CxxUtils/Array.icc index ed52609caaa02ccb3d62c7ed61fdcf442993037c..c621fbf313c975f7693e6bf5e8bd0df64b6f7443 100644 --- a/Control/CxxUtils/CxxUtils/Array.icc +++ b/Control/CxxUtils/CxxUtils/Array.icc @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: Array.icc,v 1.1 2009-03-20 20:44:22 ssnyder Exp $ @@ -714,6 +714,7 @@ WritableArray<N>::WritableArray (Arrayrep& rep, unsigned int offs) * match the length of the @c Arrayrep's shape. */ inline +// cppcheck-suppress uninitMemberVar ; false positive WritableArray<0>::WritableArray (Arrayrep& rep) : Array<0> (rep), m_elt_nc (&rep.m_data[0]) @@ -746,6 +747,7 @@ WritableArray<0>& WritableArray<0>::operator= (Arrayelt elt) * instances returned from an indexing operation. */ inline +// cppcheck-suppress uninitMemberVarPrivate ; false positive WritableArray<0>::WritableArray (Arrayrep& rep, unsigned int offs) : Array<0> (rep, offs), m_elt_nc (&rep.m_data[offs]) diff --git a/Control/CxxUtils/CxxUtils/page_access.h b/Control/CxxUtils/CxxUtils/page_access.h index 428f5e2e6351d05ce086ea7fa4011a4cd5ff4305..5be1aa942ad3b5fedacfab0d80f55b6c28deee80 100644 --- a/Control/CxxUtils/CxxUtils/page_access.h +++ b/Control/CxxUtils/CxxUtils/page_access.h @@ -25,7 +25,7 @@ size_t page_protect(T* addr, int prot) { int rc=mprotect(pageAddr, lProtected, prot); if (rc) printf("page_protect WARNING: mprotect heap failed for address %p\n", (void*)addr); #ifdef DEBUG - else printf("page_protect DEBUG: set protection @%i for range @%lx - @%lx containing addr=%p\n", + else printf("page_protect DEBUG: set protection @%i for range @%lx - @%zx containing addr=%p\n", prot,(long unsigned int)page_address(addr),(long unsigned int)addr+sizeof(T), (void*)addr); #endif return (rc == 0 ? lProtected : 0); diff --git a/Control/CxxUtils/CxxUtils/sincos.h b/Control/CxxUtils/CxxUtils/sincos.h index b111c2ff46e46cbc8e961421dceebe67fbdaf4ec..e6ba0026b44134ff1c4488195064af2ff38c254e 100644 --- a/Control/CxxUtils/CxxUtils/sincos.h +++ b/Control/CxxUtils/CxxUtils/sincos.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: sincos.h,v 1.1 2008-11-24 04:34:07 ssnyder Exp $ @@ -74,6 +74,7 @@ namespace CxxUtils { */ struct sincos { + // cppcheck-suppress uninitMemberVar ; false positive /// Calculate sine and cosine of x. sincos (double x) #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) diff --git a/Control/CxxUtils/Root/FloatPacker.cxx b/Control/CxxUtils/Root/FloatPacker.cxx index f87da885310266f635a6612da9c125f5cda0de26..645ffed5fe9ce632fbab83725dcbeeedb3e6b7a7 100644 --- a/Control/CxxUtils/Root/FloatPacker.cxx +++ b/Control/CxxUtils/Root/FloatPacker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -34,6 +34,7 @@ union ieee754_double struct { unsigned int negative:1; unsigned int exponent:11; + // cppcheck-suppress unusedStructMember unsigned int quiet_nan:1; /* Together these comprise the mantissa. */ unsigned int mantissa0:19; diff --git a/Control/CxxUtils/Root/SealDebug.cxx b/Control/CxxUtils/Root/SealDebug.cxx index 057c47ba1973f3c41e3b4f129bf76d1480d0dba0..167414c39dbd1c33b972bd3d48310b9865eaf7f5 100644 --- a/Control/CxxUtils/Root/SealDebug.cxx +++ b/Control/CxxUtils/Root/SealDebug.cxx @@ -962,6 +962,7 @@ DebugAids::coredump (int sig, ...) // to work any better, but try it anyway. Then make sure we // die so that we won't return to the caller from the child. abort (); + // cppcheck-suppress unreachableCode _exit (255); } else if (corepid > 0) { diff --git a/Control/CxxUtils/Root/SealSharedLib.cxx b/Control/CxxUtils/Root/SealSharedLib.cxx index 3657b3256430efdd4145a90a5647156215f9a7ac..29221d416cec968235e5e43ea7eb702dbdae6274 100644 --- a/Control/CxxUtils/Root/SealSharedLib.cxx +++ b/Control/CxxUtils/Root/SealSharedLib.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -82,9 +82,8 @@ namespace Athena { // wlav // wlav modified from SealBase/src/SharedLibraryError.cpp SharedLibraryError::SharedLibraryError (const std::string& context, const std::string& cause) + : m_message ("Shared library operation") { - m_message = "Shared library operation"; - if (! context.empty ()) { m_message += " "; diff --git a/Control/CxxUtils/Root/crc64.cxx b/Control/CxxUtils/Root/crc64.cxx index cb91f43abf9ac2bf3cc70c578d7d8ecf53a6b0b0..99af6c3a5239273f112b05b4b7db8d0c376e2183 100644 --- a/Control/CxxUtils/Root/crc64.cxx +++ b/Control/CxxUtils/Root/crc64.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* */ @@ -320,6 +320,9 @@ inline uint64_t hightest (uint64_t x, uint64_t y) { // Relies on sign-extension of right-shift of a signed int. + // This is strictly speakign implementation-defined behavior. + // Since this code is anyway enabled only on x86_64, that's ok. + // cppcheck-suppress shiftTooManyBitsSigned return y & (static_cast<int64_t>(x)>>63); } diff --git a/Control/CxxUtils/test/Array_test.cxx b/Control/CxxUtils/test/Array_test.cxx index 98fa4981f5b017a1a65deac28c193918af9d0f29..d2e5c446a2e6005ec7bc4ac11543bf4f3ae34a1f 100644 --- a/Control/CxxUtils/test/Array_test.cxx +++ b/Control/CxxUtils/test/Array_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: Array_test.cxx,v 1.2 2009-04-08 21:12:45 ssnyder Exp $ @@ -190,11 +190,13 @@ void test5() ++i11; assert (i11[0][0] == 4); + // cppcheck-suppress postfixOperator i11++; assert (i11[0][0] == 7); --i11; assert (i11[0][0] == 4); + // cppcheck-suppress postfixOperator i11--; assert (i11[0][0] == 1);