-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict compiler warning policy for CI builds #1203
Conversation
externals/metis/meson.build
Outdated
metis_default_warnings += ['-Wno-unused-result', | ||
'-Wno-unused-parameter', | ||
'-Wno-unused-variable', | ||
'-Wno-unused-but-set-variable', | ||
'-Wno-macro-redefined', | ||
'-Wno-unknown-pragmas', | ||
'-Wno-sign-compare', | ||
'-Wno-clobbered', | ||
'-Wno-empty-body', | ||
'-Wno-unused-label', | ||
'-Wno-misleading-indentation', | ||
'-Wno-pedantic'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe compiler warnings had not been invented when metis was written
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks pedro 💐
On top of the compiler warning changes for CI this PR contains a lot of pointers that became std::vector's, trailing whitespace cleanup and other things.
|
||
/*--- Sliding meshes variables. ---*/ | ||
|
||
su2double ****SlidingState = nullptr; | ||
int **SlidingStateNodes = nullptr; | ||
vector<su2matrix<su2double*> > SlidingState; // vector of matrix of pointers... inner dim alloc'd elsewhere (welcome, to the twilight zone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) Note to self: never deal with sliding states
@@ -2193,7 +2193,7 @@ class CFVMFlowSolverBase : public CSolver { | |||
* \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated. | |||
* \return Value of the pressure coefficient. | |||
*/ | |||
inline su2double* GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) const final { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y remove const 🐒 ? Changing to vector<su2activematrix> CharacPrimVar;
would force you to also have a const return type, right? i.e.
inline const su2double* GetCharacPrimVar(unsigned short val_marker, unsigned long val_vertex) const final {
which makes things more complicated down the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, which is one of the benefits of having container types, you can actually enforce constness of member variables. With pointers you cannot do anything.
Cvtrs.resize(nSpecies,0.0); | ||
Cvves.resize(nSpecies,0.0); | ||
eves.resize(nSpecies,0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somebody should set-up clang-tidy to format all merged PR's to get rid of those things ... I said somebody... not me :D
@@ -135,6 +134,8 @@ void CTecplotBinaryFileWriter::Write_Data(){ | |||
|
|||
#ifdef HAVE_MPI | |||
|
|||
unsigned long nParallel_Line = dataSorter->GetnElem(LINE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i don't use tecplot (so feel free to ignore) but I am curious what happened here? (Prob found because of the added compiler flags)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me neither, that variable was not used for serial compilation, locally (gcc 7.5) it was not a warning but gcc 7.4 complained
su2double C, alpha_V, alpha_T; | ||
|
||
su2double TMAC, TAC; | ||
su2double Viscosity, Eddy_Visc, Lambda; | ||
su2double Density, GasConstant; | ||
|
||
su2double **Grad_PrimVar; | ||
su2double Vector_Tangent_dT[3], Vector_Tangent_dTve[3], Vector_Tangent_HF[3]; | ||
const su2double* const* Grad_PrimVar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okok
const pointer and const values ... but I wasn't aware that the *
are split and one is with the second const which indicates a const pointer. (But I might be completely wrong here)
Did this get necesary with another change in this PR (which I missed), was it a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could put even one more const... to say that you cannot change what is points to.
It is in my todo list to create a "matrix view" to be able to access the gradient without copying and without pointers... but I will never get there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is time in the Dev meeting tomorrow I might ask you again about this (both the code and your todo-list item) ... because i did not really get it :) 🐌
su2double** YPlus = nullptr; /*!< \brief Yplus for each boundary and vertex. */ | ||
|
||
bool space_centered; /*!< \brief True if space centered scheeme used. */ | ||
vector<su2double> CNearFieldOF_Inv; /*!< \brief Near field pressure (inviscid) for each boundary. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!, I noticed that these codes from line 140 assign every boundary marker a container, even through these boundaries don't need these variable. I'm not sure if I'm understanding this correctly。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If true, I think these codes are wasting memory, and I wonder is there any better way to store these variables?
Proposed Changes
Regression tests will fail (code will not compile) on pedantic warnings, i.e. -Wall -Wextra -Wpedantic -Werror
For external libraries many warnings were manually disabled, because I don't know a better way of not having -Werror defined for them via meson.
PR Checklist