summaryrefslogtreecommitdiff
path: root/cmake/warnings.cmake
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-02 19:51:41 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-02 19:51:41 -0500
commitf7eede23de6f78b2b33b477b2b4c5451141825d5 (patch)
treed698a92272b8e4a8428b82d9a21f3e98ed267a6d /cmake/warnings.cmake
parent32c722d50943bbdeba65a77d5e94f8692cf75f3c (diff)
Add setup for coverage and cppcheck.
Diffstat (limited to 'cmake/warnings.cmake')
-rw-r--r--cmake/warnings.cmake82
1 files changed, 55 insertions, 27 deletions
diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake
index 03d7a32..cd3cdf9 100644
--- a/cmake/warnings.cmake
+++ b/cmake/warnings.cmake
@@ -1,65 +1,93 @@
set(FUD_WARNINGS
+ # baseline
-Werror
- -Wstack-usage=2048
- -Wno-long-long
- -Wno-error=long-long
- -Wno-error=inline
- -Wno-error=mismatched-tags
-Wall
- -Weffc++
+ -Wextra
-pedantic
- -Wsizeof-pointer-memaccess
-pedantic-errors
- -Wextra
+ -Wstack-usage=2048 # GCC specific
+ -Wvla # variable modified types don't play nice in C++
+ # types
+ -Wlong-long
+ -Wlong-long
+ -Winline
+ # memory / data / array / string
+ -Wsizeof-pointer-memaccess
-Wpacked
- -Wshadow
- -Wvla
- -Wnull-dereference
-Wuninitialized
-Wstack-protector
-Warray-bounds
-Woverlength-strings
-Wwrite-strings
- -Wcast-qual
-Wcast-align
- -Wdisabled-optimization
+ -Wchar-subscripts
+ -Wpointer-arith
+ -Wstrict-aliasing
+ -Wstrict-aliasing=2
+ -Wstrict-null-sentinel
+ # classes / initialization
+ -Weffc++
+ -Wmismatched-tags
-Wmissing-field-initializers
- -Wimport
-Winit-self
- -Wchar-subscripts
- -Wcomment
- -Wconversion
- -Wfloat-equal
+ -Wctor-dtor-privacy
+ -Wnon-virtual-dtor
+ -Wsuggest-final-types
+ -Wsuggest-final-methods
+ -Wsuggest-override
+ # format
-Wformat
-Wformat=2
-Wformat-nonliteral
-Wformat-security
-Wformat-y2k
-Wmissing-format-attribute
+ -Wformat-overflow
+ -Wformat-security
+ -Wformat-signedness
+ # floats and signedness
+ -Wfloat-equal
+ -Wsign-compare
+ -Wsign-conversion
+ -Wdouble-promotion
+ # semantics / style
+ -Wshadow
+ -Wnull-dereference
+ -Wimplicit-fallthrough=5
+ -Wduplicated-branches
+ -Wduplicated-cond
+ -Wcast-qual
+ -Wcomment
+ -Wconversion
-Wmissing-braces
-Winvalid-pch
-Wmissing-include-dirs
- -Wmissing-noreturn
-Wparentheses
- -Wpointer-arith
-Wredundant-decls
-Wreturn-type
-Wsequence-point
- -Wsign-compare
- -Wstrict-aliasing
- -Wstrict-aliasing=2
- -Wswitch
- -Wswitch-default
- -Wswitch-enum
-Wtrigraphs
-Wunknown-pragmas
- -Wunreachable-code
-Wunused
-Wunused-function
-Wunused-label
-Wunused-parameter
-Wunused-value
-Wunused-variable
+ -Wswitch
+ -Wswitch-default
+ -Wswitch-enum
+ # this plays badly with clangd
+ # -Wzero-as-null-pointer-constant
+ -Wlogical-op
+ -Wuseless-cast
+ -Wextra-semi
+ -Wredundant-decls
+ -Wmisleading-indentation
+ # optmizations
+ -Wdisabled-optimization
+ -Wmissing-noreturn
-Wvariadic-macros
-Wvolatile-register-var
+ -Wunreachable-code
)