diff --git a/CMakeLists.txt b/CMakeLists.txt index 92b4c744ca7..6d2567ca25c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -410,12 +410,10 @@ endif() # Compiler and system specific options if(UNIX) - #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -fno-strict-aliasing") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-strict-aliasing") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -fno-strict-aliasing") # all warnings - #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -fno-strict-aliasing -Winvalid-pch -Wnon-virtual-dtor") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-strict-aliasing -Winvalid-pch") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -fno-strict-aliasing -Winvalid-pch -Wnon-virtual-dtor") # Treat all warnings as errors set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") if(APPLE) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateTableMultiVariableLookup.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateTableMultiVariableLookup.cpp index e2a16bf2ead..6272c9362a1 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateTableMultiVariableLookup.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateTableMultiVariableLookup.cpp @@ -64,7 +64,7 @@ boost::optional ForwardTranslator::translateTableMultiVariableLookup( std::string interpolationMethod = modelObject.interpolationMethod(); int numberofIndependentVariables = modelObject.numberofIndependentVariables(); - int expectedNumberOfValues = 1; + unsigned expectedNumberOfValues = 1; for (int i = 0; i < numberofIndependentVariables; ++i) { auto xValues = modelObject.xValues(i); auto sizeX = xValues.size(); diff --git a/src/model/FanSystemModel.cpp b/src/model/FanSystemModel.cpp index 73a0c84f16b..cd7c42bfe96 100644 --- a/src/model/FanSystemModel.cpp +++ b/src/model/FanSystemModel.cpp @@ -615,6 +615,7 @@ namespace detail { void FanSystemModel_Impl::resetElectricPowerFunctionofFlowFractionCurve() { bool result = setString(OS_Fan_SystemModelFields::ElectricPowerFunctionofFlowFractionCurveName, ""); + OS_ASSERT(result); } bool FanSystemModel_Impl::setNightVentilationModePressureRise(double nightVentilationModePressureRise) { diff --git a/src/model/OutputTableSummaryReports.cpp b/src/model/OutputTableSummaryReports.cpp index 5b25192d44c..64b12f4d6ea 100644 --- a/src/model/OutputTableSummaryReports.cpp +++ b/src/model/OutputTableSummaryReports.cpp @@ -146,11 +146,11 @@ namespace detail { } bool OutputTableSummaryReports_Impl::addSummaryReports(const std::vector& summaryReports) { - unsigned int num = numberofSummaryReports(); + bool result = true; for (std::string summaryReport : summaryReports) { - addSummaryReport(summaryReport); + result &= addSummaryReport(summaryReport); } - return true; + return result; } boost::optional OutputTableSummaryReports_Impl::summaryReportIndex(const std::string& summaryReport) const { diff --git a/src/model/ShadowCalculation.cpp b/src/model/ShadowCalculation.cpp index c2e88de1582..774cde049c6 100644 --- a/src/model/ShadowCalculation.cpp +++ b/src/model/ShadowCalculation.cpp @@ -116,7 +116,6 @@ namespace detail { } int ShadowCalculation_Impl::shadingCalculationUpdateFrequency() const { - int i = OS_ShadowCalculationFields::DisableSelfShadingWithinShadingZoneGroups; boost::optional value = getInt(OS_ShadowCalculationFields::ShadingCalculationUpdateFrequency,true); OS_ASSERT(value); return value.get(); diff --git a/src/utilities/data/Attribute.cpp b/src/utilities/data/Attribute.cpp index a8685940e8d..a57a3d7c6cf 100644 --- a/src/utilities/data/Attribute.cpp +++ b/src/utilities/data/Attribute.cpp @@ -612,7 +612,7 @@ namespace detail { ss << *p; } else if (auto * p = std::get_if(&m_value)) { ss << *p; - } else if (auto * p = std::get_if>(&m_value)) { + } else if (std::get_if>(&m_value)) { // Call toXml() and save to the stringstream this->toXml().save(ss, " "); } diff --git a/src/utilities/geometry/RoofGeometry_Details.hpp b/src/utilities/geometry/RoofGeometry_Details.hpp index 55eb7d72618..cba98f4d625 100644 --- a/src/utilities/geometry/RoofGeometry_Details.hpp +++ b/src/utilities/geometry/RoofGeometry_Details.hpp @@ -28,6 +28,7 @@ #include "Geometry.hpp" #include "Vector3d.hpp" +#include "Point3d.hpp" #include #include @@ -2381,7 +2382,7 @@ static void removeEmptyLav(std::vector< std::vector< std::shared_ptr > > } } -static std::vector< std::vector > doStraightSkeleton(std::vector& polygon, double roofPitchDegrees) { +[[maybe_unused]] static std::vector< std::vector > doStraightSkeleton(std::vector& polygon, double roofPitchDegrees) { /* Straight skeleton algorithm implementation. Based on highly modified Petr * Felkel and Stepan Obdrzalek algorithm. @@ -2716,7 +2717,7 @@ static void applyGableLogicTwoRidgesTwoOppositeAngles(std::vector< std::vector

>& surfaces) { +[[maybe_unused]] static void applyGables(std::vector< std::vector >& surfaces) { // Convert hip roof to gable roof // Simple logic @@ -2776,7 +2777,7 @@ static std::vector getShedLine(std::vector& polygon, double di return line; } -static std::vector< std::vector > doShedRoof(std::vector& polygon, double roofPitchDegrees, double directionDegrees) { +[[maybe_unused]] static std::vector< std::vector > doShedRoof(std::vector& polygon, double roofPitchDegrees, double directionDegrees) { std::vector< std::vector > surfaces; double zcoord = initPolygon(polygon); diff --git a/src/utilities/sql/Test/SqlFile_GTest.cpp b/src/utilities/sql/Test/SqlFile_GTest.cpp index e27617c9ee3..ab4704602e6 100644 --- a/src/utilities/sql/Test/SqlFile_GTest.cpp +++ b/src/utilities/sql/Test/SqlFile_GTest.cpp @@ -414,7 +414,7 @@ void regressionTestSqlFile(const std::string& name, double netSiteEnergy, double ASSERT_FALSE(availableEnvPeriods.empty()); EXPECT_EQ(static_cast(3), availableEnvPeriods.size()); std::string availableEnvPeriod; - for (int i = 0; i < availableEnvPeriods.size(); i++) + for (size_t i = 0; i < availableEnvPeriods.size(); i++) { if (availableEnvPeriods[i].find("CONDNS") == std::string::npos) { availableEnvPeriod = availableEnvPeriods[i];