0
dspList_t *pDspMng = NULL;

for(pDspMng = SDSPMNG; pDspMng->mesfct != NULL && strcmp (pDspMng->mesfct, mesfct); pDspMng->prec);
INTdspmng.sc: In function 'WebCallback':
INTdspmng.sc:216:9: error: statement with no effect [-Werror=unused-value]
         for(pDspMng = SDSPMNG; pDspMng->mesfct != NULL && strcmp (pDspMng->mesfct, mesfct); pDspMng->prec);

This loop is still waiting for a new mesfct for that i make ";" after for, i want an infinite loop

7
  • What are dspList_t and SDSPMNG? Who updates mesfct? Another thread? Commented Jan 6, 2021 at 12:16
  • Your for loop does not make sense. You iterate but nothing changes from one iteration to the next. So, either you iterate only once (but without changing anything to anything) if the condition part is false, or you iterate forever without any side-effect, which is plain useless. Commented Jan 6, 2021 at 12:16
  • @Renaud how can i correct it ? , i want an infinite loop Commented Jan 6, 2021 at 12:19
  • @Jabberwocky : dsplist_t is a structure and SDSPMNG is a pointer to structure and mesfct updates by a webserver Commented Jan 6, 2021 at 12:30
  • @slamamohamed please edit the question and put all relevant information into the question. Show the declaration of the relevant structs and tell us what this "web server" is. Is it a thread? This "webserver updating mesfect" sounds very fishy. Commented Jan 6, 2021 at 12:35

1 Answer 1

1

The pDspMng->prec is practically useless. You're computing the value but doing nothing with that value. You may want to store the value in some variable, maybe like pDspMng = pDspMng->prec

Also, the ; at the end of the for loop looks erroneous.

Sign up to request clarification or add additional context in comments.

4 Comments

pDspMng->prec is not only practically useless. It is just plain useless.
how can we browse a linked list ?
i make pDspMng = pDspMng->prec and the problem resolved
@Jabberwocky better wordings. :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.