From 0fdcb1275945ea8191d404787fe570565e55b44f Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 31 Jul 2017 13:46:42 +0100 Subject: [PATCH] Updated to avoid warnings from gcc-7.1.1 --- .../interpolation2DTable.C | 4 +- .../interpolationTable/interpolationTable.C | 6 ++ .../functions/Function1/Table/TableBase.C | 2 +- .../primitives/hashes/Hasher/Hasher.C | 100 +++++++++--------- src/Pstream/mpi/UOPwrite.C | 2 - wmake/rules/linux64Gcc/c++ | 3 +- wmake/rules/linux64GccKNL/c++ | 3 +- wmake/rules/linux64Icc/c++ | 2 +- wmake/rules/linux64IccKNL/c++ | 2 +- wmake/rules/linuxARM7Gcc/c++ | 3 +- wmake/rules/linuxGcc/c++ | 3 +- wmake/rules/linuxIA64Gcc/c++ | 3 +- wmake/rules/linuxIA64Icc/c++ | 2 +- wmake/rules/linuxIcc/c++ | 2 +- wmake/rules/linuxPPC64Gcc/c++ | 3 +- wmake/rules/linuxPPC64leGcc/c++ | 3 +- wmake/rules/solaris64Gcc/c++ | 3 +- wmake/rules/solarisGcc/c++ | 3 +- 18 files changed, 83 insertions(+), 66 deletions(-) diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C index 8c88009ab8..b624145aeb 100644 --- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C +++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ -//#include "IFstream.H" #include "openFoamTableReader.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // @@ -155,6 +154,7 @@ Type Foam::interpolation2DTable::interpolateValue << "bound (" << minLimit << ")" << nl << " Continuing with the first entry" << endl; + // Behaviour as per CLAMP return data.first().second(); break; @@ -185,6 +185,7 @@ Type Foam::interpolation2DTable::interpolateValue << "bound (" << maxLimit << ")" << nl << " Continuing with the last entry" << endl; + // Behaviour as per CLAMP return data.last().second(); break; @@ -263,6 +264,7 @@ Foam::label Foam::interpolation2DTable::Xi WarningInFunction << "value (" << valueX << ") out of bounds" << endl; + // Behaviour as per CLAMP return limitI; break; diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C index 2e31e93723..8b162427e7 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C @@ -195,6 +195,7 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const << "value (" << lookupValue << ") underflow" << nl << " Zero rate of change." << endl; + // Behaviour as per CLAMP return 0; break; @@ -230,6 +231,7 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const << "value (" << lookupValue << ") overflow" << nl << " Zero rate of change." << endl; + // Behaviour as per CLAMP return 0; break; @@ -341,6 +343,7 @@ Foam::interpolationTable::operator[](const label i) const << "index (" << ii << ") underflow" << nl << " Continuing with the first entry" << endl; + // Behaviour as per 'CLAMP' ii = 0; break; @@ -377,6 +380,7 @@ Foam::interpolationTable::operator[](const label i) const << "index (" << ii << ") overflow" << nl << " Continuing with the last entry" << endl; + // Behaviour as per 'CLAMP' ii = n - 1; break; @@ -432,6 +436,7 @@ Type Foam::interpolationTable::operator()(const scalar value) const << "value (" << lookupValue << ") underflow" << nl << " Continuing with the first entry" << endl; + // Behaviour as per CLAMP return this->first().second(); break; @@ -467,6 +472,7 @@ Type Foam::interpolationTable::operator()(const scalar value) const << "value (" << lookupValue << ") overflow" << nl << " Continuing with the last entry" << endl; + // Behaviour as per 'CLAMP' return this->last().second(); break; diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C index eb3bdbf0de..0efcbcf146 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C index 56b35b8e61..b967be7d16 100644 --- a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C +++ b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -221,16 +221,16 @@ static unsigned jenkins_hashlittle switch (length) { case 12: c += k[2]; b += k[1]; a += k[0]; break; - case 11: c += static_cast(k8[10]) << 16; // fall through - case 10: c += static_cast(k8[9]) << 8; // fall through - case 9 : c += k8[8]; // fall through + case 11: c += static_cast(k8[10]) << 16; [[fallthrough]]; + case 10: c += static_cast(k8[9]) << 8; [[fallthrough]]; + case 9 : c += k8[8]; [[fallthrough]]; case 8 : b += k[1]; a += k[0]; break; - case 7 : b += static_cast(k8[6]) << 16; // fall through - case 6 : b += static_cast(k8[5]) << 8; // fall through - case 5 : b += k8[4]; // fall through + case 7 : b += static_cast(k8[6]) << 16; [[fallthrough]]; + case 6 : b += static_cast(k8[5]) << 8; [[fallthrough]]; + case 5 : b += k8[4]; [[fallthrough]]; case 4 : a += k[0]; break; - case 3 : a += static_cast(k8[2]) << 16; // fall through - case 2 : a += static_cast(k8[1]) << 8; // fall through + case 3 : a += static_cast(k8[2]) << 16; [[fallthrough]]; + case 2 : a += static_cast(k8[1]) << 8; [[fallthrough]]; case 1 : a += k8[0]; break; case 0 : return c; // zero-length requires no mixing } @@ -262,7 +262,7 @@ static unsigned jenkins_hashlittle break; case 11: c += static_cast(k8[10]) << 16; - // fall through + [[fallthrough]]; case 10: c += k[4]; b += k[2] + (static_cast(k[3]) << 16); @@ -270,27 +270,27 @@ static unsigned jenkins_hashlittle break; case 9 : c += k8[8]; - // fall through + [[fallthrough]]; case 8 : b += k[2] + (static_cast(k[3]) << 16); a += k[0] + (static_cast(k[1]) << 16); break; case 7 : b += static_cast(k8[6]) << 16; - // fall through + [[fallthrough]]; case 6 : b += k[2]; a += k[0] + (static_cast(k[1]) << 16); break; case 5 : b += k8[4]; - // fall through + [[fallthrough]]; case 4 : a += k[0] + (static_cast(k[1]) << 16); break; case 3 : a += static_cast(k8[2]) << 16; - // fall through + [[fallthrough]]; case 2 : a += k[0]; break; @@ -328,19 +328,19 @@ static unsigned jenkins_hashlittle // last block: affect all 32 bits of (c) switch (length) // most case statements fall through { - case 12: c += static_cast(k[11]) << 24; - case 11: c += static_cast(k[10]) << 16; - case 10: c += static_cast(k[9]) << 8; - case 9 : c += k[8]; + case 12: c += static_cast(k[11]) << 24; [[fallthrough]]; + case 11: c += static_cast(k[10]) << 16; [[fallthrough]]; + case 10: c += static_cast(k[9]) << 8; [[fallthrough]]; + case 9 : c += k[8]; [[fallthrough]]; - case 8 : b += static_cast(k[7]) << 24; - case 7 : b += static_cast(k[6]) << 16; - case 6 : b += static_cast(k[5]) << 8; - case 5 : b += k[4]; + case 8 : b += static_cast(k[7]) << 24; [[fallthrough]]; + case 7 : b += static_cast(k[6]) << 16; [[fallthrough]]; + case 6 : b += static_cast(k[5]) << 8; [[fallthrough]]; + case 5 : b += k[4]; [[fallthrough]]; - case 4 : a += static_cast(k[3]) << 24; - case 3 : a += static_cast(k[2]) << 16; - case 2 : a += static_cast(k[1]) << 8; + case 4 : a += static_cast(k[3]) << 24; [[fallthrough]]; + case 3 : a += static_cast(k[2]) << 16; [[fallthrough]]; + case 2 : a += static_cast(k[1]) << 8; [[fallthrough]]; case 1 : a += k[0]; break; @@ -398,16 +398,16 @@ static unsigned jenkins_hashbig switch (length) // most the case statements fall through { case 12: c += k[2]; b += k[1]; a += k[0]; break; - case 11: c += static_cast(k8[10]) << 8; // fall through - case 10: c += static_cast(k8[9]) << 16; // fall through - case 9 : c += static_cast(k8[8]) << 24; // fall through + case 11: c += static_cast(k8[10]) << 8; [[fallthrough]]; + case 10: c += static_cast(k8[9]) << 16; [[fallthrough]]; + case 9 : c += static_cast(k8[8]) << 24; [[fallthrough]]; case 8 : b += k[1]; a += k[0]; break; - case 7 : b += static_cast(k8[6]) << 8; // fall through - case 6 : b += static_cast(k8[5]) << 16; // fall through - case 5 : b += static_cast(k8[4]) << 24; // fall through + case 7 : b += static_cast(k8[6]) << 8; [[fallthrough]]; + case 6 : b += static_cast(k8[5]) << 16; [[fallthrough]]; + case 5 : b += static_cast(k8[4]) << 24; [[fallthrough]]; case 4 : a += k[0]; break; - case 3 : a += static_cast(k8[2]) << 8; // fall through - case 2 : a += static_cast(k8[1]) << 16; // fall through + case 3 : a += static_cast(k8[2]) << 8; [[fallthrough]]; + case 2 : a += static_cast(k8[1]) << 16; [[fallthrough]]; case 1 : a += static_cast(k8[0]) << 24; break; case 0 : return c; } @@ -441,18 +441,18 @@ static unsigned jenkins_hashbig // last block: affect all 32 bits of (c) switch (length) // the case statements fall through { - case 12: c += k[11]; - case 11: c += static_cast(k[10]) << 8; - case 10: c += static_cast(k[9]) << 16; - case 9 : c += static_cast(k[8]) << 24; - case 8 : b += k[7]; - case 7 : b += static_cast(k[6]) << 8; - case 6 : b += static_cast(k[5]) << 16; - case 5 : b += static_cast(k[4]) << 24; - case 4 : a += k[3]; - case 3 : a += static_cast(k[2]) << 8; - case 2 : a += static_cast(k[1]) << 16; - case 1 : a += static_cast(k[0]) << 24; + case 12: c += k[11]; [[fallthrough]]; + case 11: c += static_cast(k[10]) << 8; [[fallthrough]]; + case 10: c += static_cast(k[9]) << 16; [[fallthrough]]; + case 9 : c += static_cast(k[8]) << 24; [[fallthrough]]; + case 8 : b += k[7]; [[fallthrough]]; + case 7 : b += static_cast(k[6]) << 8; [[fallthrough]]; + case 6 : b += static_cast(k[5]) << 16; [[fallthrough]]; + case 5 : b += static_cast(k[4]) << 24; [[fallthrough]]; + case 4 : a += k[3]; [[fallthrough]]; + case 3 : a += static_cast(k[2]) << 8; [[fallthrough]]; + case 2 : a += static_cast(k[1]) << 16; [[fallthrough]]; + case 1 : a += static_cast(k[0]) << 24; [[fallthrough]]; break; case 0 : return c; } @@ -521,10 +521,11 @@ unsigned Foam::HasherInt // handle the last 3 uint32_t's switch (length) // all case statements fall through { - case 3 : c += k[2]; - case 2 : b += k[1]; + case 3 : c += k[2]; [[fallthrough]]; + case 2 : b += k[1]; [[fallthrough]]; case 1 : a += k[0]; bitMixerFinal(a,b,c); + [[fallthrough]]; case 0 : // case 0: nothing left to add break; } @@ -567,10 +568,11 @@ unsigned Foam::HasherDual // handle the last 3 uint32_t's switch (length) // all case statements fall through { - case 3 : c += k[2]; - case 2 : b += k[1]; + case 3 : c += k[2]; [[fallthrough]]; + case 2 : b += k[1]; [[fallthrough]]; case 1 : a += k[0]; bitMixerFinal(a,b,c); + [[fallthrough]]; case 0 : // case 0: nothing left to add break; } diff --git a/src/Pstream/mpi/UOPwrite.C b/src/Pstream/mpi/UOPwrite.C index 563163966c..e0b2264395 100644 --- a/src/Pstream/mpi/UOPwrite.C +++ b/src/Pstream/mpi/UOPwrite.C @@ -146,6 +146,4 @@ bool Foam::UOPstream::write } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++ index fd17d5b805..48bd03b3b9 100644 --- a/wmake/rules/linux64Gcc/c++ +++ b/wmake/rules/linux64Gcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linux64GccKNL/c++ b/wmake/rules/linux64GccKNL/c++ index 22537b0485..caeee4f5cc 100644 --- a/wmake/rules/linux64GccKNL/c++ +++ b/wmake/rules/linux64GccKNL/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linux64Icc/c++ b/wmake/rules/linux64Icc/c++ index aed1dbbd9a..0f48796fa0 100644 --- a/wmake/rules/linux64Icc/c++ +++ b/wmake/rules/linux64Icc/c++ @@ -1,7 +1,7 @@ SUFFIXES += .C c++WARN = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \ - -diag-disable 327,654,1125,2289,2304,11062,11074,11076 + -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076 # Suppress some warnings for flex++ and CGAL c++LESSWARN = -diag-disable 1224,2026,2305 diff --git a/wmake/rules/linux64IccKNL/c++ b/wmake/rules/linux64IccKNL/c++ index 377d602387..a84129bd73 100644 --- a/wmake/rules/linux64IccKNL/c++ +++ b/wmake/rules/linux64IccKNL/c++ @@ -1,7 +1,7 @@ SUFFIXES += .C c++WARN = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \ - -diag-disable 654,1125,2304 + -diag-disable 654,1125,1292,2304 # Suppress some warnings for flex++ and CGAL c++LESSWARN = -diag-disable 1224,2026,2305 diff --git a/wmake/rules/linuxARM7Gcc/c++ b/wmake/rules/linuxARM7Gcc/c++ index 0a7cc5b7fe..bc5ccb42bf 100644 --- a/wmake/rules/linuxARM7Gcc/c++ +++ b/wmake/rules/linuxARM7Gcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++ index 38201d2c50..94bf753197 100644 --- a/wmake/rules/linuxGcc/c++ +++ b/wmake/rules/linuxGcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linuxIA64Gcc/c++ b/wmake/rules/linuxIA64Gcc/c++ index 2f8c58892f..f91f1d8270 100644 --- a/wmake/rules/linuxIA64Gcc/c++ +++ b/wmake/rules/linuxIA64Gcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linuxIA64Icc/c++ b/wmake/rules/linuxIA64Icc/c++ index f2f7278db6..70c00d3ead 100644 --- a/wmake/rules/linuxIA64Icc/c++ +++ b/wmake/rules/linuxIA64Icc/c++ @@ -1,7 +1,7 @@ SUFFIXES += .C c++WARN = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \ - -diag-disable 2304 + -diag-disable 2304,1292 # Suppress some warnings for flex++ and CGAL c++LESSWARN = -diag-disable 1224,2026,2305 diff --git a/wmake/rules/linuxIcc/c++ b/wmake/rules/linuxIcc/c++ index 79f3cf93d4..8e59e33cc2 100644 --- a/wmake/rules/linuxIcc/c++ +++ b/wmake/rules/linuxIcc/c++ @@ -1,7 +1,7 @@ SUFFIXES += .C c++WARN = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \ - -diag-disable 327,654,1125,2289,2304,11062,11074,11076 + -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076 # Suppress some warnings for flex++ and CGAL c++LESSWARN = -diag-disable 1224,2026,2305 diff --git a/wmake/rules/linuxPPC64Gcc/c++ b/wmake/rules/linuxPPC64Gcc/c++ index b32a38f19e..35d902a04c 100644 --- a/wmake/rules/linuxPPC64Gcc/c++ +++ b/wmake/rules/linuxPPC64Gcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/linuxPPC64leGcc/c++ b/wmake/rules/linuxPPC64leGcc/c++ index e97ed991a2..69b4f5f981 100644 --- a/wmake/rules/linuxPPC64leGcc/c++ +++ b/wmake/rules/linuxPPC64leGcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds diff --git a/wmake/rules/solaris64Gcc/c++ b/wmake/rules/solaris64Gcc/c++ index 20b9a01368..0844f2afab 100644 --- a/wmake/rules/solaris64Gcc/c++ +++ b/wmake/rules/solaris64Gcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN = diff --git a/wmake/rules/solarisGcc/c++ b/wmake/rules/solarisGcc/c++ index cc4f8fd71c..7bc009b73c 100644 --- a/wmake/rules/solarisGcc/c++ +++ b/wmake/rules/solarisGcc/c++ @@ -1,6 +1,7 @@ SUFFIXES += .C -c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof +c++WARN = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \ + -Wno-invalid-offsetof -Wno-attributes # Suppress some warnings for flex++ and CGAL c++LESSWARN =