[PATCH 3/5] testsuite/smokey/vxworktests: Fix compile error seen with gcc 16

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
Fixes the following error:

task-2.c: In function ‘backgroundTask’:
task-2.c:26:42: error: variable ‘count’ set but not used [-Werror=unused-but-set-variable=]
   26 |         unsigned int safety = 100000000, count = 0;
      |                                          ^~~~~
cc1: all warnings being treated as errors

Signed-off-by: Florian Bezdeka <[email protected]>
---
 testsuite/smokey/vxworkstests/task-2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/testsuite/smokey/vxworkstests/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
index 0cbb9e18a13383418c4360241ef244b8a24da975..ed3e31806baad930bb30edc53d2dc6b6e51d6277 100644
--- a/testsuite/smokey/vxworkstests/task-2.c
+++ b/testsuite/smokey/vxworkstests/task-2.c
@@ -23,7 +23,7 @@ static SEM_ID sem_id, fdone_sem_id;
 
 static void backgroundTask(long arg, ...)
 {
-	unsigned int safety = 100000000, count = 0;
+	unsigned int safety = 100000000;
 	int ret;
 
 	traceobj_enter(&trobj);
@@ -35,8 +35,7 @@ static void backgroundTask(long arg, ...)
 
 	traceobj_mark(&trobj, 2);
 
-	while (--safety > 0)
-		count++;
+	while (--safety > 0) {}
 
 	/*
 	 * Enter infinite pause so that any pending cancellation is

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.