ericmckean / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

gcc 4.8 array-bounds warnings #734

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
v1.3.0-1837-g7c6337b

-Warray-bounds is enabled with -Wall. gcc 4.8 is a bit more table size aware 
and warns in cases where the loop range is something like [0, int_variable). If 
the size was previously validated an assert is enough to quiet it, much like 
other static analysis cases.
Full log attached.

---
    [CC] vpx/src/svc_encodeframe.c.o
vpx/src/svc_encodeframe.c: In function 'vpx_svc_init':
vpx/src/svc_encodeframe.c:567:54: warning: array subscript is above array 
bounds [-Warray-bounds]
             (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total);
                                                      ^
vpx/src/svc_encodeframe.c:566:35: warning: array subscript is above array 
bounds [-Warray-bounds]
         enc_cfg->ss_target_bitrate[i] = (unsigned int)
                                   ^
vpx/src/svc_encodeframe.c:567:54: warning: array subscript is above array 
bounds [-Warray-bounds]
             (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total);
                                                      ^
vpx/src/svc_encodeframe.c:566:35: warning: array subscript is above array 
bounds [-Warray-bounds]
         enc_cfg->ss_target_bitrate[i] = (unsigned int)
                                   ^
...
    [CC] vp8/encoder/onyx_if.c.o
vp8/encoder/onyx_if.c: In function 'vp8_get_compressed_data':
vp8/encoder/onyx_if.c:5077:23: warning: array subscript is above array bounds 
[-Warray-bounds]
                     lc->framerate = cpi->ref_framerate /
                       ^

Original issue reported on code.google.com by jz...@google.com on 15 Mar 2014 at 1:20

Attachments:

GoogleCodeExporter commented 9 years ago
https://gerrit.chromium.org/gerrit/#/q/status:merged+project:webm/libvpx+branch:
master+topic:array-bounds-warnings,n,z

The build should be clear at v1.3.0-1897-g55dbbbb

Original comment by jz...@google.com on 19 Mar 2014 at 3:07