From: Simon Marchi Date: Wed, 10 Nov 2021 13:42:25 +0000 (-0500) Subject: Fix: tests: fix unused-but-set warning in test_fd_tracker.c X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3a5f70173aa04d11ccb22694d5d31a702cad33ab;p=lttng-tools.git Fix: tests: fix unused-but-set warning in test_fd_tracker.c When building with clang-14 on Ubuntu 20.04, I get: CC test_fd_tracker.o /home/smarchi/src/lttng-tools/tests/unit/test_fd_tracker.c:169:15: error: variable 'fds_set_to_minus_1' set but not used [-Werror,-Wunused-but-set-variable] unsigned int fds_set_to_minus_1 = 0; ^ The compiler seems right, so remove fds_set_to_minus_1. It might be that the intention was to assert something using this variable, but I couldn't figure it out. Change-Id: I12bfd07bca7829de8d5b85d375d9b52bd84d677a Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_fd_tracker.c b/tests/unit/test_fd_tracker.c index 345eaf256..73010c4c1 100644 --- a/tests/unit/test_fd_tracker.c +++ b/tests/unit/test_fd_tracker.c @@ -166,7 +166,6 @@ void untrack_std_fds(struct fd_tracker *tracker) { .fd = fileno(stdout), .name = "stdout" }, { .fd = fileno(stderr), .name = "stderr" }, }; - unsigned int fds_set_to_minus_1 = 0; for (i = 0; i < sizeof(files) / sizeof(*files); i++) { int fd = files[i].fd; @@ -175,7 +174,6 @@ void untrack_std_fds(struct fd_tracker *tracker) ok(ret == 0, "Untrack unsuspendable fd %d (%s)", fd, files[i].name); - fds_set_to_minus_1 += (files[i].fd == -1); } }