Commit d33271c
committed
ioq: Rewrite the spin loop to avoid a warning
With some GCC versions, --enable-ubsan leads to this warning:
src/ioq.c: In function ‘ioq_slot_wait’:
src/ioq.c:287:17: warning: ignoring loop annotation
287 | for (int j = 0; j < (1 << i); ++j) {
| ^~~
presumably due to UBSan rewriting the shift to check for overflow. Work
around this by precomputing the iteration count.1 parent 1b79747 commit d33271c
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | | - | |
285 | | - | |
| 284 | + | |
286 | 285 | | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
| |||
0 commit comments