ufz / ogs5

OpenGeoSys THM/C simulator version 5
https://www.opengeosys.org/ogs-5
Other
39 stars 97 forks source link

Disabled gcc compilation warnings in ThirdParty #131

Closed wenqing closed 5 years ago

wenqing commented 5 years ago

as titled.

Besides, it fixes some warnings in the files in OGS.

wenqing commented 5 years ago

@bilke Please take a look at the changes in ThirdParty/CMakeLists.txt, which disable compilation warnings in ThirdParty.

bilke commented 5 years ago

@wenqing Instead of setting the cxx flags are more modern CMake approach is to use add_compile_options(), e.g.:

add_compile_options(
    -Wno-unused-result
    -Wno-unused-variable
    -Wno-unused-but-set-variable
    -Wno-unused-parameter
    -Wno-sign-compare
    -Wno-format
    -Wno-extra
)

Or simply disable all warnings: add_compile_options(-w)?

I also suggest to just set this once for all targets in ThirdParty, i.e. not inside the if() clauses, e.g. if(OGS_CHEMSOLVER STREQUAL IPQC).

wenqing commented 5 years ago

@bilke Took

add_compile_options(
    -Wno-unused-result
    -Wno-unused-variable
    -Wno-unused-but-set-variable
    -Wno-unused-parameter
    -Wno-sign-compare
    -Wno-format
    -Wno-extra
)

for ThirdParty/CMakeLists.txt.

Now, Parallel Stage / Win has problem:

java.nio.channels.ClosedChannelException
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 141.65.34.105/141.65.34.105:58676
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
        at hudson.remoting.Request.call(Request.java:202)
bilke commented 5 years ago

@wenqing I restarted the Win build which ran fine.

If you like I can enable warning thresholds for the current state, e.g. 0 for FEM, 4 for PETSc, and so on. Or do you want to fix a few of the remaining warnings before setting the threshold?

wenqing commented 5 years ago

@bilke It is nice that you can enable warning thresholds for the current state. Please go forward. With the current compilation options, this PR does not give compilation warnings. I prefer to fix the remaining warnings after setting the threshold.