[sw] Enable More Warnings
In this commit, we increase the meson warning level, which in this case
enables `-Wextra`. Given we have warnings-as-errors, this commit also
turns off specific warning kinds which are triggered in existing code.
It is our intention to remove these ignores in the future.
Signed-off-by: Sam Elliott <selliott@lowrisc.org>
diff --git a/meson.build b/meson.build
index 286e297..7699ff1 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,7 @@
'build.c_std=c11',
'cpp_std=c++14',
'build.cpp_std=c++14',
- 'warning_level=1',
+ 'warning_level=2',
'werror=true',
'debug=true',
'b_staticpic=false', # Disable PIC for device static libraries
@@ -47,6 +47,11 @@
'-Wimplicit-fallthrough', # Error on implicit fallthrough
'-Wswitch-default', # Ensure all switches have default statements
'-Wno-covered-switch-default', # We require `default:` always.
+ # Issues we intend to fix in the future but are currently ignored as there are
+ # many places they are triggered.
+ '-Wno-unused-parameter',
+ '-Wno-sign-compare',
+ '-Wno-missing-field-initializers',
]
# C compiler arguments to optimize for size, used on cross builds only.