From 690f8fce44ac257bbc39c33b23f8840a254d8534 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 30 Jul 2017 20:36:21 -0700 Subject: [PATCH] test: avoid -Wunused-variable on NoAsserts build Ensure that the variable is referenced to avoid an unused variable warning from GCC/clang when building the tests in a Release+NoAsserts configuration. This is done as part of the swift build on Linux for SourceKit. --- tests/bsdtestharness.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bsdtestharness.c b/tests/bsdtestharness.c index 2a19a0f86..eab84b3ea 100644 --- a/tests/bsdtestharness.c +++ b/tests/bsdtestharness.c @@ -128,6 +128,7 @@ main(int argc, char *argv[]) tv_wall.tv_usec = labs(tv_stop.tv_usec - tv_start.tv_usec); int res2 = wait4(pid, &status, 0, &usage); + (void)res2; assert(res2 != -1); test_long("Process exited", (WIFEXITED(status) && WEXITSTATUS(status) && WEXITSTATUS(status) != 0xff) || WIFSIGNALED(status), 0); printf("[PERF]\twall time: %ld.%06ld\n", tv_wall.tv_sec, tv_wall.tv_usec);