Skip to content

Commit

Permalink
Merge pull request #2366 from angmolin/bugfix/gcc+12-strict-overflow-…
Browse files Browse the repository at this point in the history
…warning

Fix strict-overflow warning when compiling with gcc >= 12
  • Loading branch information
HiFiPhile authored Dec 10, 2023
2 parents 338ff2d + 506617d commit 71f1400
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/class/audio/audio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,8 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
{
uint8_t const *p_desc = _audiod_fct[i].p_desc;
uint8_t const *p_desc_end = p_desc + _audiod_fct[i].desc_length - TUD_AUDIO_DESC_IAD_LEN;
while (p_desc < p_desc_end)
// Condition modified from p_desc < p_desc_end to prevent gcc>=12 strict-overflow warning
while (p_desc_end - p_desc > 0)
{
if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT)
{
Expand Down

0 comments on commit 71f1400

Please sign in to comment.