Bug 1411 - Compiler warnings when building with gcc 9
Summary: Compiler warnings when building with gcc 9
Status: RESOLVED FIXED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Driver: asix-sigma (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-30 00:58 CEST by Uwe Hermann
Modified: 2019-12-19 22:10 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2019-08-30 00:58:15 CEST
With gcc 9.2.1:

../src/hardware/asix-sigma/protocol.c: In function ‘download_capture’:
../src/hardware/asix-sigma/protocol.c:175:7: warning: array subscript -1 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
  175 |  if ((*--triggerpos & 0x1ff) == 0x1ff)
      |       ^~~~~~~~~~~~~
../src/hardware/asix-sigma/protocol.c:1002:20: note: while referencing ‘triggerpos’
 1002 |  uint32_t stoppos, triggerpos;
      |                    ^~~~~~~~~~
../src/hardware/asix-sigma/protocol.c:176:15: warning: array subscript -1 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
  176 |   *triggerpos -= 64;
      |   ~~~~~~~~~~~~^~~~~
../src/hardware/asix-sigma/protocol.c:1002:20: note: while referencing ‘triggerpos’
 1002 |  uint32_t stoppos, triggerpos;
      |                    ^~~~~~~~~~
Comment 1 Uwe Hermann 2019-12-19 22:10:37 CET
Fixed in dc40081706b0bb77dde412a08f6234809fca4946, thanks!