Skip to content

Commit

Permalink
Toolchain: Add -Werror=unused-parameter and -Werror=unused-label
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Jan 29, 2023
1 parent 9f57795 commit 755e56a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions tools/conventions/analyze_gfortran_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"-Winteger-division",
"-Wmaybe-uninitialized",
"-Wfunction-elimination",
"-Wunused-function",
"Creating array temporary",
"quality comparison",
"defined but not used",
"Removing call to function",
"Conversion from",
"Non-significant digits in 'REAL(8)'",
Expand Down Expand Up @@ -87,14 +87,6 @@ def check_warnings(fhandle):
if any(iw in warning for iw in IGNORED_WARNINGS):
continue

if "Unused" in warning:
if "'error'" in warning:
continue
if "'routinep'" in warning:
continue
if loc_short == "cp_common_uses.f90":
continue

if ("CHARACTER expression" in warning) and ("truncated" in warning):
continue

Expand Down
4 changes: 2 additions & 2 deletions tools/toolchain/scripts/generate_arch_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ PROFOPT_FLAGS="\$(PROFOPT)"
# special flags for gfortran
# https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html
# we error out for these warnings (-Werror=uninitialized -Wno-maybe-uninitialized -> error on variables that must be used uninitialized)
WFLAGS_ERROR="-Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized"
WFLAGS_ERROR="-Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=unused-parameter -Werror=unused-label -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized"
# we just warn for those (that eventually might be promoted to WFLAGSERROR). It is useless to put something here with 100s of warnings.
WFLAGS_WARN="-Wuninitialized -Wuse-without-only"
# while here we collect all other warnings, some we'll ignore
# TODO: -Wpedantic with -std2008 requires an upgrade of the MPI interfaces from mpi to mpi_f08
WFLAGS_WARNALL="-Wno-pedantic -Wall -Wextra -Wsurprising -Wunused-parameter -Warray-temporaries -Wcharacter-truncation -Wconversion-extra -Wimplicit-interface -Wimplicit-procedure -Wreal-q-constant -Walign-commons -Wfunction-elimination -Wrealloc-lhs -Wcompare-reals -Wzerotrip"
WFLAGS_WARNALL="-Wno-pedantic -Wall -Wextra -Wsurprising -Warray-temporaries -Wcharacter-truncation -Wconversion-extra -Wimplicit-interface -Wimplicit-procedure -Wreal-q-constant -Walign-commons -Wfunction-elimination -Wrealloc-lhs -Wcompare-reals -Wzerotrip"

# IEEE_EXCEPTIONS dependency
IEEE_EXCEPTIONS_DFLAGS="-D__HAS_IEEE_EXCEPTIONS"
Expand Down

0 comments on commit 755e56a

Please sign in to comment.