From 7495f83e2a6e1aa69592fcda6e5c6c1b0b4fa118 Mon Sep 17 00:00:00 2001 From: Vy Nguyen Date: Fri, 20 Oct 2023 08:51:32 -0400 Subject: [PATCH] Set -Wno-unused-variable for tests (#1682) We used assert() a lot in tests and that can cause build breakages in some of the opt builds (since assert() are removed) it's not practical to sprinkle "(void)" everywhere so I think setting this warning option is the best option for now. --- test/BUILD | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/BUILD b/test/BUILD index ea34fd4646..22b7dba4b9 100644 --- a/test/BUILD +++ b/test/BUILD @@ -18,6 +18,9 @@ TEST_COPTS = [ # "-Wshorten-64-to-32", "-Wfloat-equal", "-fstrict-aliasing", + ## assert() are used a lot in tests upstream, which may be optimised out leading to + ## unused-variable warning. + "-Wno-unused-variable", ] # Some of the issues with DoNotOptimize only occur when optimization is enabled