Skip to content
Snippets Groups Projects
Commit b7143678 authored by Soeren Peters's avatar Soeren Peters
Browse files

ADds -Wextra and -pedantic flag and removes a few warnings.

parent 051cc181
No related branches found
No related tags found
1 merge request!20Remove all warnings in VirtualFluids CPU (Closes #6, #7)
...@@ -16,7 +16,10 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fPIC") # position indepe ...@@ -16,7 +16,10 @@ list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-fPIC") # position indepe
# warnings # warnings
############################################################################################################# #############################################################################################################
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wall")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wunreachable-code") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wextra")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-pedantic")
#list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wunreachable-code")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-unused-function")
list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder") list(APPEND CAB_COMPILER_ADDTIONAL_CXX_COMPILER_FLAGS "-Wno-reorder")
...@@ -228,7 +228,7 @@ inline std::string UbLogger<OutputPolicy>::logTimeString() ...@@ -228,7 +228,7 @@ inline std::string UbLogger<OutputPolicy>::logTimeString()
char buffer[11]; char buffer[11];
time_t t; time_t t;
time(&t); time(&t);
tm r = { 0 }; tm r; // = { 0 };
strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r)); strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r));
struct timeval tv; struct timeval tv;
gettimeofday(&tv, 0); gettimeofday(&tv, 0);
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override; void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override;
void translate(const double &x1, const double &x2, const double &x3) override; void translate(const double &x1, const double &x2, const double &x3) override;
void rotate(const double &rx1, const double &rx2, const double &rx3) override {} void rotate(const double &rx1, const double &rx2, const double &rx3) override { (void)rx1; (void)rx2; (void)rx3; }
void scale(const double &sx1, const double &sx2, const double &sx3) override; void scale(const double &sx1, const double &sx2, const double &sx3) override;
double getLengthX1(); double getLengthX1();
......
...@@ -83,7 +83,7 @@ vector<GbTriangle3D *> GbObjectGroup3D::getSurfaceTriangleSet() ...@@ -83,7 +83,7 @@ vector<GbTriangle3D *> GbObjectGroup3D::getSurfaceTriangleSet()
return allTriangles; return allTriangles;
} }
/*=======================================================*/ /*=======================================================*/
void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &nodes, vector<UbTupleInt3> &triangles) {} void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3> &/*nodes*/, vector<UbTupleInt3> &/*triangles*/) {}
/*=======================================================*/ /*=======================================================*/
bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D /*origin*/, GbPoint3D /*direction*/) { return false; } bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D /*origin*/, GbPoint3D /*direction*/) { return false; }
/*=======================================================*/ /*=======================================================*/
......
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
this->midPoint->translate(x1, x2, x3); this->midPoint->translate(x1, x2, x3);
this->notifyObserversObjectChanged(); this->notifyObserversObjectChanged();
} }
void rotate(const double &rx1, const double &rx2, const double &rx3) override void rotate(const double &/*rx1*/, const double &/*rx2*/, const double &/*rx3*/) override
{ /* rotation makes no sense*/ { /* rotation makes no sense*/
} }
void scale(const double &sx1, const double & /*sx2*/, const double & /*sx3*/) override { this->radius *= sx1; } void scale(const double &sx1, const double & /*sx2*/, const double & /*sx3*/) override { this->radius *= sx1; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment