diff options
| author | HiFiPhile <[email protected]> | 2023-12-10 17:22:43 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-10 17:22:43 +0100 |
| commit | 71f1400aea9f7111ab6cfbcefd0551326edf51da (patch) | |
| tree | a3ddb2ac3ac07f725703f6a115e4ab825e06bd3f /src | |
| parent | 338ff2daba63fc60835934efc374c818f7c5980c (diff) | |
| parent | 506617d4b39ba9118a24477a4be6db9733e2e2f1 (diff) | |
Merge pull request #2366 from angmolin/bugfix/gcc+12-strict-overflow-warning
Fix strict-overflow warning when compiling with gcc >= 12
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/audio/audio_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/class/audio/audio_device.c b/src/class/audio/audio_device.c index 9af999992..d438d0715 100644 --- a/src/class/audio/audio_device.c +++ b/src/class/audio/audio_device.c @@ -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) { |
