Skip to content

Commit a64a047

Browse files
committed
I was getting a warning/error saying
'cipher-ctr-mt-functions.c: In function ‘thread_loop’: cipher-ctr-mt-functions.c:218:13: error: variable ‘qidx’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] 218 | int qidx; | ^~~~ cc1: all warnings being treated as errors ' Moving the initialization of qidx from the top of the function to the for loop declaration resolved this.
1 parent 7a5ffb6 commit a64a047

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cipher-ctr-mt-functions.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ thread_loop(void *job)
215215
struct aes_mt_ctx_st *aes_mt_ctx = job;
216216
struct kq *q;
217217
struct aes_mt_ctx_ptrs *ptr;
218-
int qidx;
219218
pthread_t first_tid;
220219
int outlen;
221220
u_char mynull[KQLEN * AES_BLOCK_SIZE];
@@ -284,7 +283,7 @@ thread_loop(void *job)
284283
* when empty. The first thread to wake will mark it as filling,
285284
* others will move on to fill, skip, or wait on the next queue.
286285
*/
287-
for (qidx = 1;; qidx = (qidx + 1) % numkq) {
286+
for (int qidx = 1;; qidx = (qidx + 1) % numkq) {
288287
/* Check if I was cancelled, also checked in cond_wait */
289288
pthread_testcancel();
290289

0 commit comments

Comments
 (0)