[asterisk-bugs] [JIRA] (ASTERISK-27580) [patch] lpc10: Array may be uninitialized.
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Thu May 28 08:13:25 CDT 2020
[ https://issues.asterisk.org/jira/browse/ASTERISK-27580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250966#comment-250966 ]
Alexander Traud commented on ASTERISK-27580:
--------------------------------------------
Not sure what to do with this.
GCC 9, the default compiler in Ubuntu 20.04 LTS does not exhibit this anymore. GCC 8 does not exhibit this either. Furthermore, I was not able to determine which optimization is triggering this exactly. In Ubuntu 18.04 LTS with its default compiler GCC 7, I went for {{./configure --enable-dev-mode=noisy}}, copied the GCC invocation, and tried that with {{-O2}} plus the [additional flags|https://github.com/gcc-mirror/gcc/blob/releases/gcc-7/gcc/opts.c#L527] from {{-O3}}. Then, I am not facing that warning. Only if I go for {{-O3}}, I get that warning. Go figure! Additionally, to be honest, I do not see the code path which might give an uninitialized state. The next step would be to live-debugging GCC itself. However, all still supported GCC releases do not emit this warning anymore = GCC 7 is not an supported release already.
Therefore, I am not sure what do with this. Ubuntu 18.04 LTS is still going to be around for three years. Finally, the Asterisk Developer Mode activates {{-Werror}} normally. However, [not with|https://github.com/asterisk/asterisk/commit/8d6d166b14b5c3cb569670a8501cfb808ab19b57#diff-da3571cce673e671b995201bd3e6700b] the codec module LPC10. Consequently, is this printed warning just cosmetic?
> [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: 16.10.0, 17.4.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.4.0), Ubuntu 18.04 LTS (GCC 7.5.0) 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 or -Ofast.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list