GridOPTICS / GridPACK

https://www.gridpack.org/
47 stars 22 forks source link

Remove compiler warning suppression, and fix the code #169

Open wperkins opened 1 year ago

wperkins commented 1 year ago

Prompted by a conversation with @abhyshr ... In the root CMakeList.txt file, we have this:

# -------------------------------------------------------------
# Compiler specific options
# -------------------------------------------------------------

# FIXME: remove annoying warnings (these warnings probably identify
# real problems, but there are so many of them they obscure errors
# that are causing identifiable problems

if (CMAKE_COMPILER_IS_GNUCXX) 
  add_definitions(
    -pedantic
    -Wno-write-strings
    -Wno-long-long 
    -Wno-sign-compare 
    -Wno-unused-variable
    -Wno-unused-but-set-variable
    -Wno-maybe-uninitialized
    )
endif()

# using regular Clang or AppleClang
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_definitions(
    -Wno-c++11-extensions
    -Wno-c++11-compat-deprecated-writable-strings
    -Wno-format-security
    -DGRIDPACK_AVOID_APPLECLANG_MPI_PROBLEMS=1
    )
endif()

I remember adding several of these suppression options (and the FIXME comment). We should work towards fixing the code that generate the warnings, because they may indicate real problems. I'm not necessarily advocating making all warnings into errors, just cutting the volume. It's going to be a bit of a challenge to eliminate some, like -Wno-write-strings and some generated by boost.

wperkins commented 11 months ago

I think this needs to be postponed.