Skip to content

Commit 73e8dfd

Browse files
committed
suppress "-Wstrict-overflow" in tusb_fifo.c
1 parent ab03be5 commit 73e8dfd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/common/tusb_fifo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
325325
// We are exploiting the wrap around to the correct index
326326

327327
// TODO warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
328+
#pragma GCC diagnostic push
329+
#pragma GCC diagnostic ignored "-Wstrict-overflow"
330+
328331
if ((p > p + offset) || (p + offset > f->max_pointer_idx))
329332
{
330333
p = (p + offset) + f->non_used_index_space;
@@ -333,6 +336,9 @@ static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
333336
{
334337
p += offset;
335338
}
339+
340+
#pragma GCC diagnostic pop
341+
336342
return p;
337343
}
338344

0 commit comments

Comments
 (0)