Fix fifo overflow correction.#940
Conversation
|
For I feel like the check can be simplified into |
The first condition covers the case when |
| @@ -325,7 +325,7 @@ static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset) | |||
| // We are exploiting the wrap around to the correct index | |||
|
|
|||
| // TODO warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow] | |||
There was a problem hiding this comment.
The GCC seem to be right about this. I got the warning when compiling with gnu++17, haven't got time to trace it down. So I put the warning comment here. Thanks for the PR.
hathach
left a comment
There was a problem hiding this comment.
Superb! Thank you @HiFiPhile for fixing the issue and @PanRe for reviewing it. I will try to recompile with gcc++17 later on, and remove warning comment if it is indeed the case.
Describe the PR
Fix fifo overflow correction.
Additional context
If applicable, add any other context about the PR and/or screenshots here.