build: enable GCC warnings
Enable a bunch of warnings that help keep the code robust, portable and
maintainable.
Notably, the following desirable warnings cannot be enabled because of
pending issues in the code:
Wconversion
Wsign-conversion
Wnull-dereference
Wshadow
Tested by building and running the unit tests.
Change-Id: I75627056ca9e8fd475aced172bf54983b6737bf4
Signed-off-by: Brad Bishop <bradbish@qti.qualcomm.com>
diff --git a/meson.build b/meson.build
index 38edc51..7945276 100644
--- a/meson.build
+++ b/meson.build
@@ -19,6 +19,19 @@
if (cxx.version().version_compare('<13.0'))
error('This project requires gcc-13 or higher')
endif
+
+ add_project_arguments(
+ '-Wformat=2',
+ '-Wcast-align',
+ '-Woverloaded-virtual',
+ '-Wunused',
+ '-Wduplicated-cond',
+ '-Wduplicated-branches',
+ '-Wlogical-op',
+ '-Wunused-parameter',
+ '-Wdouble-promotion',
+ language: 'cpp',
+ )
endif
# Enable debugging for debug builds