[Asterisk-code-review] app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS (asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed Feb 24 08:13:02 CST 2021


Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15441 )

Change subject: app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS
......................................................................


Patch Set 3:

> Patch Set 3:
> 
> > Patch Set 3:
> > 
> > > Patch Set 3:
> > > 
> > > Apparently this wasn't a straight up revert, as I can't build func_callerid now:
> > > 
> > > func_callerid.c: In function ‘redirecting_read’:
> > > func_callerid.c:1489:37: error: array subscript 0 is outside the bounds of an interior zero-length array ‘char *[0]’ [-Werror=zero-length-bounds]
> > >  1489 |  if (!strcasecmp("orig", member.argv[0])) {
> > >       |                          ~~~~~~~~~~~^~~
> > > func_callerid.c:425:53: note: while referencing ‘argv’
> > >   425 | AST_DEFINE_APP_ARGS_TYPE(ast_party_members,
> > >       |                                                     ^   
> > > func_callerid.c:1467:27: note: defined here ‘member’
> > >  1467 |  struct ast_party_members member = { 0, };
> > >       |                           ^~~~~~
> > > 
> > > Along with more.
> > 
> > What the hell.  Ok, the error makes sense since it's static analysis there.  May I inquire your build environment?  Happy to find a resolution for you but I need to be able to reproduce first.  And given ./configure; make; make that ain't happening.
> > 
> > That is actually a very good analysis though, either way, I get that it's an issue, but why use member.argv[0] here instead of member.subnames[0]?  Suspect this is where the other more complicated patch was probably better.
> 
> Ubuntu 20.10, gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)

Oh, and ./configure executed with --enable-dev-mode and DONT_OPTIMIZE set in menuselect.


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15441
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I5b9f02a9b290675682a1d13f1788fdda597c9fca
Gerrit-Change-Number: 15441
Gerrit-PatchSet: 3
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Wed, 24 Feb 2021 14:13:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210224/19663d84/attachment.html>


More information about the asterisk-code-review mailing list