[asterisk-bugs] [JIRA] (ASTERISK-23556) Compilation warning for invert.c (array subscript is above array bounds)

Alexander Traud (JIRA) noreply at issues.asterisk.org
Thu Apr 28 09:19:57 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-23556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Traud updated ASTERISK-23556:
---------------------------------------

    Attachment: LPC-10_since_GCC_4_8_1.patch

Because {{*order}} is 10 (always), the array subscript cannot be above the bounds. Anyway on Ubuntu 16.04 LTS (GCC 5.3.1-14ubuntu2), this warning is emitted (only) when COMPILE_DOUBLE is enabled. The attached patch avoids that warning message for me. Alternatively, you replace {{*order}} with {{10}}. Steps to reproduce on Ubuntu 16.04 LTS:
{noformat}sudo apt install libssl-dev libncurses-dev libnewt-dev libxml2-dev libsqlite3-dev uuid-dev libjansson-dev libblocksruntime-dev
wget downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar zxf ./asterisk-1*
cd ./asterisk-1*
./configure
make menuselect.makeopts
./menuselect/menuselect --enable DONT_OPTIMIZE
make{noformat}

> Compilation warning for invert.c (array subscript is above array bounds)
> ------------------------------------------------------------------------
>
>                 Key: ASTERISK-23556
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23556
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Codecs/codec_lpc10, Core/BuildSystem
>    Affects Versions: 11.22.0, 13.8.2
>         Environment: gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
>            Reporter: Marcello Ceschia
>            Severity: Critical
>         Attachments: LPC-10_since_GCC_4_8_1.patch
>
>
> {code}
>    [CC] invert.c -> invert.o
> invert.c: In function ‘invert_’:
> invert.c:167:24: warning: array subscript is above array bounds [-Warray-bounds]
>       rc[j] -= rc[k] * v[j + k * 10 - 11];
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list