Skip to content

Commit

Permalink
Fix #4038 - Re-enable -Wall on Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Aug 11, 2020
1 parent 9b82631 commit 99aa952
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ boost::optional<IdfObject> 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();
Expand Down
1 change: 1 addition & 0 deletions src/model/FanSystemModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/model/OutputTableSummaryReports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ namespace detail {
}

bool OutputTableSummaryReports_Impl::addSummaryReports(const std::vector<std::string>& summaryReports) {
unsigned int num = numberofSummaryReports();
bool result = true;
for (std::string summaryReport : summaryReports) {
addSummaryReport(summaryReport);
result &= addSummaryReport(summaryReport);
}
return true;
return result;
}

boost::optional<unsigned> OutputTableSummaryReports_Impl::summaryReportIndex(const std::string& summaryReport) const {
Expand Down
1 change: 0 additions & 1 deletion src/model/ShadowCalculation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ namespace detail {
}

int ShadowCalculation_Impl::shadingCalculationUpdateFrequency() const {
int i = OS_ShadowCalculationFields::DisableSelfShadingWithinShadingZoneGroups;
boost::optional<int> value = getInt(OS_ShadowCalculationFields::ShadingCalculationUpdateFrequency,true);
OS_ASSERT(value);
return value.get();
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/data/Attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ namespace detail {
ss << *p;
} else if (auto * p = std::get_if<std::string>(&m_value)) {
ss << *p;
} else if (auto * p = std::get_if<std::vector<Attribute>>(&m_value)) {
} else if (std::get_if<std::vector<Attribute>>(&m_value)) {
// Call toXml() and save to the stringstream
this->toXml().save(ss, " ");
}
Expand Down
7 changes: 4 additions & 3 deletions src/utilities/geometry/RoofGeometry_Details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "Geometry.hpp"
#include "Vector3d.hpp"
#include "Point3d.hpp"
#include <boost/optional.hpp>
#include <boost/math/constants/constants.hpp>

Expand Down Expand Up @@ -2381,7 +2382,7 @@ static void removeEmptyLav(std::vector< std::vector< std::shared_ptr<Vertex> > >
}
}

static std::vector< std::vector<Point3d> > doStraightSkeleton(std::vector<Point3d>& polygon, double roofPitchDegrees) {
[[maybe_unused]] static std::vector< std::vector<Point3d> > doStraightSkeleton(std::vector<Point3d>& polygon, double roofPitchDegrees) {

/* Straight skeleton algorithm implementation. Based on highly modified Petr
* Felkel and Stepan Obdrzalek algorithm.
Expand Down Expand Up @@ -2716,7 +2717,7 @@ static void applyGableLogicTwoRidgesTwoOppositeAngles(std::vector< std::vector<P

}

static void applyGables(std::vector< std::vector<Point3d> >& surfaces) {
[[maybe_unused]] static void applyGables(std::vector< std::vector<Point3d> >& surfaces) {
// Convert hip roof to gable roof

// Simple logic
Expand Down Expand Up @@ -2776,7 +2777,7 @@ static std::vector<Point3d> getShedLine(std::vector<Point3d>& polygon, double di
return line;
}

static std::vector< std::vector<Point3d> > doShedRoof(std::vector<Point3d>& polygon, double roofPitchDegrees, double directionDegrees) {
[[maybe_unused]] static std::vector< std::vector<Point3d> > doShedRoof(std::vector<Point3d>& polygon, double roofPitchDegrees, double directionDegrees) {
std::vector< std::vector<Point3d> > surfaces;

double zcoord = initPolygon(polygon);
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/sql/Test/SqlFile_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void regressionTestSqlFile(const std::string& name, double netSiteEnergy, double
ASSERT_FALSE(availableEnvPeriods.empty());
EXPECT_EQ(static_cast<unsigned>(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];
Expand Down

0 comments on commit 99aa952

Please sign in to comment.