diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C index 41965cf27b..7b4ee0a964 100644 --- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C +++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C @@ -148,6 +148,7 @@ Type Foam::interpolation2DTable::interpolateValue << " Continuing with the first entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolation2DTable::CLAMP: { @@ -176,6 +177,7 @@ Type Foam::interpolation2DTable::interpolateValue << " Continuing with the last entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolation2DTable::CLAMP: { @@ -252,6 +254,7 @@ Foam::label Foam::interpolation2DTable::Xi << "value (" << valueX << ") out of bounds" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolation2DTable::CLAMP: { diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C index b0dfd76fea..62805890da 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C @@ -272,6 +272,7 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const << " Zero rate of change." << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { @@ -305,6 +306,7 @@ Type Foam::interpolationTable::rateOfChange(const scalar value) const << " Zero rate of change." << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { @@ -414,6 +416,7 @@ Foam::interpolationTable::operator[](const label i) const << " Continuing with the first entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { @@ -448,6 +451,7 @@ Foam::interpolationTable::operator[](const label i) const << " Continuing with the last entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { @@ -501,6 +505,7 @@ Type Foam::interpolationTable::operator()(const scalar value) const << " Continuing with the first entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { @@ -534,6 +539,7 @@ Type Foam::interpolationTable::operator()(const scalar value) const << " Continuing with the last entry" << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case interpolationTable::CLAMP: { diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C index 95a5fce3e4..a50c988e09 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 @@ -239,6 +239,7 @@ bool Foam::Function1Types::TableBase::checkMinBounds << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case CLAMP: { @@ -289,6 +290,7 @@ bool Foam::Function1Types::TableBase::checkMaxBounds << endl; // fall-through to 'CLAMP' + [[fallthrough]]; } case CLAMP: { diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C index f0c51aa45a..dfa2e10b37 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 @@ -224,16 +224,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 } @@ -265,7 +265,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); @@ -273,27 +273,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; @@ -331,19 +331,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; @@ -403,16 +403,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; } @@ -446,18 +446,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; } @@ -539,10 +539,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; } @@ -585,10 +586,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 =