[asterisk-bugs] [JIRA] (ASTERISK-29144) GCC Warnings with OPTIMIZE=-Og make

Asterisk Team (JIRA) noreply at issues.asterisk.org
Thu Oct 29 08:18:15 CDT 2020


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

Asterisk Team commented on ASTERISK-29144:
------------------------------------------

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

> GCC Warnings with OPTIMIZE=-Og make
> -----------------------------------
>
>                 Key: ASTERISK-29144
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29144
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: . I did not set the category correctly.
>    Affects Versions: 16.14.0, 18.0.0
>            Reporter: Alexander Traud
>            Severity: Trivial
>
> {code}./configure
> OPTIMIZE=-Og make{code}gives the following five warnings in Ubuntu 20.10 with GCC 10.2:{code}chan_audiosocket.c: In function ‘audiosocket_request’:
> chan_audiosocket.c:261:4: warning: ‘fd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   261 |    close(fd);
>       |    ^~~~~~~~~
> app_directory.c: In function ‘select_item_menu’:
> app_directory.c:412:39: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
>   412 |    snprintf(buf, sizeof(buf), "digits/%d", i + 1);
>       |                                       ^~
> app_directory.c:412:31: note: directive argument in the range [1, 2147483647]
>   412 |    snprintf(buf, sizeof(buf), "digits/%d", i + 1);
>       |                               ^~~~~~~~~~~
> In file included from /usr/include/stdio.h:866,
>                  from .../asterisk-18.0.0/include/asterisk/compat.h:49,
>                  from .../asterisk-18.0.0/include/asterisk.h:22,
>                  from app_directory.c:31:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:70:10: note: ‘__builtin___snprintf_chk’ output between 9 and 18 bytes into a destination of size 9
>    70 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    71 |        __bos (__s), __fmt, __va_arg_pack ());
>       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> app_voicemail.c: In function ‘vm_authenticate’:
> app_voicemail.c:11284:15: warning: ‘passptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 11284 |   if (vmu && !strcmp(passptr, password))
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~
> func_odbc.c: In function ‘init_acf_query’:
> .../asterisk-18.0.0/include/asterisk/astmm.h:244:2: warning: ‘tmp2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   244 |  __ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__)
>       |  ^~~~~~~~~~~~
> func_odbc.c:1184:14: note: ‘tmp2’ was declared here
>  1184 |  const char *tmp2;
>       |              ^~~~
> ooh323c/src/ooq931.c: In function ‘ooDecodeUUIE’:
> ooh323c/src/ooq931.c:620:27: error: ‘ie’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>   620 |    setPERBuffer (pctxt, ie->data, ie->length, aligned);
>       |                         ~~^~~~~~{code}The workaround is trivial because these warnings can be ignored. However, when using {{./configure --enable-developer-mode}} those warnings turn into errors. Surprisingly, those warnings do not happen with any other [optimization options|http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html] like ones normally used in Asterisk: {{-O0}} and {{-O3}}. Only {{./apps/app_directory.c}} also warns not only at {{-Og}} but also on {{-O1}}.



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



More information about the asterisk-bugs mailing list