aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build35
1 files changed, 32 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index c180449..bc72ff3 100644
--- a/meson.build
+++ b/meson.build
@@ -37,12 +37,41 @@ add_project_arguments(cxx.get_supported_arguments([
# clang specific
'-mspeculative-load-hardening', # Spectre v1 mitigation
- '-Wconsumed', # use-after-move warnings
'-Xclang -plugin-arg-clazy -Xclang level0,level1', # clazy default warning level
+ ## warnings
+ # variables
+ '-Wunused', # warn on anything being unused
+ '-Wshadow', # if variable declaration shadows one from a parent context
+ # functions
+ '-Wnon-virtual-dtor', # if class with virtual functions has non-virtual dtor
+ '-Werror=missing-declarations', # missing function declarations in header files
+ '-Werror=redundant-decls',
+ '-Woverloaded-virtual', # warn if you overload (not override) a virtual function
+ '-Werror=return-type',
+ # style
+ '-Wformat=2', # security issues around printf
'-Wdate-time', # __TIME__ and __DATE__ macros
- '-Wimplicit-fallthrough', # switch implicit fallthrough
- '-Wold-style-cast' # c-style casts
+ '-Werror=missing-field-initializers',
+ # objects
+ '-Wnull-dereference',
+ '-Wconsumed', # use-after-move warnings
+ '-Wlifetime', # object lifetime issues
+ # logic
+ '-Wlogical-op', # logical operations being used where bitwise were probably wanted
+ '-Wimplicit-fallthrough',
+ '-Wduplicated-cond', # if/else chain has duplicated conditions
+ '-Wduplicated-brances', # if/else branches have duplicated code
+ # casts
+ '-Wold-style-cast',
+ '-Wcast-align', # potential performance problem casts
+ '-Wuseless-cast', # cast to same type
+ '-Wconversion', # type conversions that may lose data
+ '-Wsign-conversion', # sign conversions
+ '-Wdouble-promotion', # float is promoted to double
+ # others
+ '-Werror=pedantic', # if non-standard c++ is used
+ #'-Weffc++',
]), language: 'cpp')
if get_option('buildtype') == 'release'