Skip to content

Commit dfca8fc

Browse files
andreasstiegermsune
authored andcommitted
stack_test: fix build with GCC 16
Fixes -Werror=unused-but-set-variable on jj. Starting with GCC 16, var pre/postincrements and var @= expr no longer count as uses at some warning levels.
1 parent 8ece66a commit dfca8fc

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

test/stack_test.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,7 @@ int _test_u552_push_pop(){
746746
TEST_ASSERT(rv == CDADA_SUCCESS);
747747
TEST_ASSERT(key.mid == 1);
748748

749-
int jj;
750-
for(jj = 0, i=0;i<5; ++i, jj += 1){
749+
for(i=0;i<5; ++i){
751750
key.mid = 0;
752751
rv = cdada_stack_push(stack, &key);
753752
TEST_ASSERT(rv == CDADA_SUCCESS);
@@ -906,8 +905,7 @@ int test_u3552_push_pop_custom(){
906905
TEST_ASSERT(rv == CDADA_SUCCESS);
907906
TEST_ASSERT(key.mid == 1);
908907

909-
int jj;
910-
for(jj = 0, i=0;i<5; ++i, jj += 1){
908+
for(i=0;i<5; ++i){
911909
key.mid = 0;
912910
rv = cdada_stack_push(stack, &key);
913911
TEST_ASSERT(rv == CDADA_SUCCESS);

0 commit comments

Comments
 (0)