clear all warnings and enable -Werror

This commit is contained in:
Jake Hillion 2023-03-16 06:36:30 -07:00 committed by Jake Hillion
parent 9fced15433
commit 06aa3e3d40
3 changed files with 14 additions and 4 deletions

View File

@ -36,8 +36,8 @@ constexpr auto outputEnvKey = "OID_METRICS_OUTPUT";
* "oid_metrics.json".
*/
struct TraceFlags {
bool time : 1 = false;
bool rss : 1 = false;
bool time = false;
bool rss = false;
operator bool() const {
return time || rss;

View File

@ -2,9 +2,16 @@ definitions = '''
struct Foo10 {
int arr[10];
};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wzero-length-array"
struct Foo0 {
int arr[0];
};
using ZeroLengthIntArray = int[0];
#pragma clang diagnostic pop
struct MultiDim {
int arr[2][3];
};
@ -59,7 +66,7 @@ definitions = '''
# WARNING: zero-length arrays are handled differently to non-empty arrays.
# They end up not being treated as containers. This should probably change
# in the future.
param_types = ["int[0]"]
param_types = ["ZeroLengthIntArray"]
setup = "return {};"
expect_json = '[{"staticSize":0, "dynamicSize":0}]'
[cases.ref_int10]
@ -72,6 +79,6 @@ definitions = '''
# WARNING: zero-length arrays are handled differently to non-empty arrays.
# They end up not being treated as containers. This should probably change
# in the future.
param_types = ["const int(&)[0]"]
param_types = ["const ZeroLengthIntArray&"]
setup = "return {};"
expect_json = '[{"staticSize":0, "dynamicSize":0}]'

View File

@ -56,7 +56,10 @@ def add_test_setup(f, config):
f"\n"
f'{config.get("raw_definitions", "")}\n'
f"namespace {ns} {{\n"
f"#pragma clang diagnostic push\n"
f"#pragma clang diagnostic ignored \"-Wunused-private-field\"\n"
f'{config.get("definitions", "")}\n'
f"#pragma clang diagnostic pop\n"
)
# fmt: on