[asterisk-bugs] [JIRA] (ASTERISK-27580) [patch] lpc10: Array may be uninitialized.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Fri Jan 12 13:28:39 CST 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241518#comment-241518 ] 

Alexander Traud commented on ASTERISK-27580:
--------------------------------------------

I am not happy with the patch. Perhaps one day, I find the time to investigate what GCC is doing exactly. Especially because that happens only at -O3 and higher. -O2 and lower, everything is fine. However, I wonder why nobody reported that before. This seems to be an issue since GCC 4.8.

> [patch] lpc10: Array may be uninitialized.
> ------------------------------------------
>
>                 Key: ASTERISK-27580
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27580
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Codecs/codec_lpc10
>    Affects Versions: 15.2.0
>            Reporter: Alexander Traud
>            Severity: Minor
>              Labels: patch
>         Attachments: lpc10_array_init.patch
>
>
> {{./configure && make}} and Ubuntu 14.04 LTS (GCC 4.8.2), Ubuntu 16.04 LTS (GCC 5.3.1), Ubuntu 18.04 LTS (GCC 7.2) report:{code}irc2pc.c:145:12: warning: 'temp[9]' may be used uninitialized in this function [-Wmaybe-uninitialized]
>       pc[j] = temp[j - 1];
>       ~~~~~~^~~~~~~~~~~~~
> irc2pc.c:145:12: warning: 'temp[8]' may be used uninitialized in this function [-Wmaybe-uninitialized]
> irc2pc.c:145:12: warning: 'temp[7]' may be used uninitialized in this function [-Wmaybe-uninitialized]{code}This does not happen, when optimization is level 2 or lower, like off. This does not happen in the alternative compiler _clang_. It is just GCC with (Asterisk’s default of) -O3.



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



More information about the asterisk-bugs mailing list