From 750f2b4b3d59a9cd23bf8c50ed3c4774eddda8e7 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 6 Nov 2019 03:43:58 -0700 Subject: [PATCH] thread: fix set-but-unused warning In release builds, the assert() is compiled out, making it look like the rc value is never referenced after it's set. Signed-off-by: Jim Harris Change-Id: I59305b0e928f2044146e30b7addc86f81e7a1d3f Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473472 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker --- lib/thread/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index cf3c7d6ca..b22b9c309 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -1199,7 +1199,7 @@ spdk_for_each_channel(void *io_device, spdk_channel_msg fn, void *ctx, struct spdk_thread *thread; struct spdk_io_channel *ch; struct spdk_io_channel_iter *i; - int rc; + int rc __attribute__((unused)); i = calloc(1, sizeof(*i)); if (!i) {