Skip to content

Commit

Permalink
Set all currently-clean GCC warnings to promoted
Browse files Browse the repository at this point in the history
I looped over a (theoretically) complete list of warnings that are
supported by GCC 10 and checked which of them do not occur anywhere in
Trilinos (non-deprecated packages only).  Promote all clean warnings to
have the cleanest compile output currently possible and prevent
introducing any of these warnings in the future.

Also remove all options related to the promoted warnings that were
previously passed in `config-specs.ini`, since we want to Build The Way
Everybody Does.

Signed-off-by: Samuel E. Browne <[email protected]>
  • Loading branch information
sebrowne committed Jan 2, 2025
1 parent 58dd4be commit b09c98e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Framework
if either of these modes are enabled, all warnings are disabled for any
deprecated packages, in the interest of not spending effort cleaning them.
By default, no warnings or errors are added.
- Set all currently-clean GCC 10 warnings as 'promoted'.


###############################################################################
Expand Down
29 changes: 28 additions & 1 deletion cmake/ProjectCompilerPostConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,34 @@ IF (KokkosEnable)
ENDIF()

set(upcoming_warnings shadow ${Trilinos_ADDITIONAL_WARNINGS})
set(promoted_warnings parentheses sign-compare unused-variable reorder uninitialized)
set(promoted_warnings
address
aggressive-loop-optimizations
builtin-declaration-mismatch
cast-align
deprecated-declarations
div-by-zero
format-extra-args
format
format-zero-length
init-self
inline
int-to-pointer-cast
parentheses
reorder
return-type
sequence-point
sign-compare
strict-aliasing
type-limits
uninitialized
unused-function
unused-label
unused-value
unused-variable
variadic-macros
write-strings
)

if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN")
enable_warnings("${upcoming_warnings}")
Expand Down
12 changes: 6 additions & 6 deletions packages/framework/ini-files/config-specs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ opt-set-cmake-var TPL_ENABLE_Scotch BOOL FORCE : OFF
opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ${NETCDF_C_LIB|ENV}/libnetcdf.so

opt-set-cmake-var Trilinos_ENABLE_Fortran OFF BOOL : OFF
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-label
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-unused-label

[rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_all]
use rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
Expand Down Expand Up @@ -1636,7 +1636,7 @@ use SPACK_NETLIB_BLAS_LAPACK
opt-set-cmake-var MPI_EXEC_PRE_NUMPROCS_FLAGS STRING : --bind-to;none --mca btl vader,self
opt-set-cmake-var CMAKE_CXX_EXTENSIONS BOOL : OFF
opt-set-cmake-var Teko_DISABLE_LSCSTABALIZED_TPETRA_ALPAH_INV_D BOOL : ON
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-inline -Wno-nonnull-compare -Wno-address
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address

opt-set-cmake-var TPL_HDF5_LIBRARIES STRING : ${HDF5_LIB|ENV}/libhdf5_hl.so;${HDF5_LIB|ENV}/libhdf5.so;${ZLIB_LIB|ENV}/libz.so;-ldl

Expand Down Expand Up @@ -1672,7 +1672,7 @@ opt-set-cmake-var ROL_example_PDE-OPT_helmholtz_example_02_MPI_1_DISABLE BOOL
opt-set-cmake-var Pliris_vector_random_MPI_3_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_4_DISABLE BOOL : ON

opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

# Test failures as of 11-28-22
opt-set-cmake-var ROL_example_PDE-OPT_navier-stokes_example_01_MPI_4_DISABLE BOOL : ON
Expand Down Expand Up @@ -1766,7 +1766,7 @@ use PACKAGE-ENABLES|NO-PACKAGE-ENABLES
use COMMON_SPACK_TPLS

opt-set-cmake-var MPI_EXEC_PRE_NUMPROCS_FLAGS STRING : --bind-to;none --mca btl vader,self
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

opt-set-cmake-var TPL_ENABLE_SuperLUDist BOOL FORCE : ON
opt-set-cmake-var TPL_ENABLE_ParMETIS BOOL FORCE : ON
Expand Down Expand Up @@ -1814,7 +1814,7 @@ use PACKAGE-ENABLES|NO-PACKAGE-ENABLES

use COMMON_SPACK_TPLS

opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-but-set-variable -Wno-unused-label
opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-unused-but-set-variable -Wno-unused-label

opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ""

Expand Down Expand Up @@ -1853,7 +1853,7 @@ opt-set-cmake-var ROL_example_PDE-OPT_helmholtz_example_02_MPI_1_DISABLE BOO
opt-set-cmake-var ROL_example_PDE-OPT_navier-stokes_example_01_MPI_4_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_3_DISABLE BOOL : ON
opt-set-cmake-var Pliris_vector_random_MPI_4_DISABLE BOOL : ON
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline
opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare

opt-set-cmake-var TPL_ENABLE_SuperLUDist BOOL FORCE: OFF

Expand Down

0 comments on commit b09c98e

Please sign in to comment.