From 9c4dd932c6d692178bb8d5265c634126cb415767 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 26 May 2020 22:23:25 +0300 Subject: Turn on more warnings by default - fix clazy warnings - fix various other compiler warnings - bugfix: connect profiles' downloadRequested signal --- meson.build | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'meson.build') 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' -- cgit v1.2.1