Skip to content

Commit 06aa3e3

Browse files
committed
clear all warnings and enable -Werror
1 parent 9fced15 commit 06aa3e3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/Metrics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ constexpr auto outputEnvKey = "OID_METRICS_OUTPUT";
3636
* "oid_metrics.json".
3737
*/
3838
struct TraceFlags {
39-
bool time : 1 = false;
40-
bool rss : 1 = false;
39+
bool time = false;
40+
bool rss = false;
4141

4242
operator bool() const {
4343
return time || rss;

test/integration/arrays.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ definitions = '''
22
struct Foo10 {
33
int arr[10];
44
};
5+
6+
#pragma clang diagnostic push
7+
#pragma clang diagnostic ignored "-Wzero-length-array"
58
struct Foo0 {
69
int arr[0];
710
};
11+
12+
using ZeroLengthIntArray = int[0];
13+
#pragma clang diagnostic pop
14+
815
struct MultiDim {
916
int arr[2][3];
1017
};
@@ -59,7 +66,7 @@ definitions = '''
5966
# WARNING: zero-length arrays are handled differently to non-empty arrays.
6067
# They end up not being treated as containers. This should probably change
6168
# in the future.
62-
param_types = ["int[0]"]
69+
param_types = ["ZeroLengthIntArray"]
6370
setup = "return {};"
6471
expect_json = '[{"staticSize":0, "dynamicSize":0}]'
6572
[cases.ref_int10]
@@ -72,6 +79,6 @@ definitions = '''
7279
# WARNING: zero-length arrays are handled differently to non-empty arrays.
7380
# They end up not being treated as containers. This should probably change
7481
# in the future.
75-
param_types = ["const int(&)[0]"]
82+
param_types = ["const ZeroLengthIntArray&"]
7683
setup = "return {};"
7784
expect_json = '[{"staticSize":0, "dynamicSize":0}]'

test/integration/gen_tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def add_test_setup(f, config):
5656
f"\n"
5757
f'{config.get("raw_definitions", "")}\n'
5858
f"namespace {ns} {{\n"
59+
f"#pragma clang diagnostic push\n"
60+
f"#pragma clang diagnostic ignored \"-Wunused-private-field\"\n"
5961
f'{config.get("definitions", "")}\n'
62+
f"#pragma clang diagnostic pop\n"
6063
)
6164

6265
# fmt: on

0 commit comments

Comments
 (0)