how to remove the following lint warning in C?
c, lint, loops
Solution
As your code is written, the loop will not be entered. `NUM_DAYS % NUM_PERSON` will evaluate to `true`, so `num` will equal `NUM_DAYS / NUM_PERSON`. Since we are dealing with ints, `65 / 33` is equal to `1`. `1 -1` is `0`, so the while condition will fail.
If your code is written as intended (as in, those constants are the values you are expecting to always use), just remove the while loop. It will never be used. If, however, `NUM_DAYS` or `NUM_PERSON` may later contain other values, you probably have nothing to worry about. If those specific values aren't important, try setting them to values such that the division will evaluate to something greater than `1`.
Problem
I have the following code: ``` #define NUM_DAYS 65 #define NUM_PERSON 33 int num = 0; if(NUM_DAYS % NUM_PERSON) { num = NUM_DAYS / NUM_PERSON; } else { uum = NUM_DAY / NUM_PERSON + 1; } num = num - 1; while(num > 0) { //do something here } ``` but I got the following lint warning: ``` Warning 681: Loop is not entered ``` what is the problem and how to fix it?