[asterisk-bugs] [JIRA] (ASTERISK-29711) aelparse: GCC 11.2 found two maybe uninitialized
Friendly Automation (JIRA)
noreply at issues.asterisk.org
Mon Nov 1 09:19:49 CDT 2021
[ https://issues.asterisk.org/jira/browse/ASTERISK-29711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256738#comment-256738 ]
Friendly Automation commented on ASTERISK-29711:
------------------------------------------------
Change 16659 merged by Friendly Automation:
various: Fix GCC 11.2 compilation issues.
[https://gerrit.asterisk.org/c/asterisk/+/16659|https://gerrit.asterisk.org/c/asterisk/+/16659]
> aelparse: GCC 11.2 found two maybe uninitialized
> ------------------------------------------------
>
> Key: ASTERISK-29711
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-29711
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Utilities/aelparse
> Affects Versions: 16.21.1, 18.7.1
> Environment: Ubuntu 21.10
> Reporter: Alexander Traud
> Assignee: Sean Bright
>
> {code} [CC] extconf.c -> extconf.o
> extconf.c: In function ‘ast_config_internal_load’:
> extconf.c:2896:18: warning: ‘db’ may be used uninitialized [-Wmaybe-uninitialized]
> 2896 | result = loader->load_func(db, table, filename, cfg, withcomments, suggested_incl_file);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> extconf.c:2896:18: note: by argument 1 of type ‘const char *’ to ‘config_load_func’ {aka ‘struct ast_config *(const char *, const char *, const char *, struct ast_config *, int, const char *)’}
> extconf.c:2866:14: note: ‘db’ declared here
> 2866 | char db[256];
> | ^~
> extconf.c:2896:18: warning: ‘table’ may be used uninitialized [-Wmaybe-uninitialized]
> 2896 | result = loader->load_func(db, table, filename, cfg, withcomments, suggested_incl_file);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> extconf.c:2896:18: note: by argument 2 of type ‘const char *’ to ‘config_load_func’ {aka ‘struct ast_config *(const char *, const char *, const char *, struct ast_config *, int, const char *)’}
> extconf.c:2867:14: note: ‘table’ declared here
> 2867 | char table[256];
> | ^~~~~
> {code}
> I do not think the solution is initializing the variables {{db}} and {{table}} because I do not know what happens if those are {{NULL}} either. Perhaps someone knows what that code does, I do not understand it to be able to change the control flow. Therefore, just reporting.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list