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

Jaco Kroon asteriskteam at digium.com
Wed Feb 10 11:41:56 CST 2021


Jaco Kroon has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15399 )

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


Patch Set 1: Code-Review-1

Jean,

Not completely against the patch, working on the same problem currently, and I think there is a simpler fix, and that's to just revert the diff as introduced by:

commit 3d1bf3c537bba0416f691f48165fdd0a32554e8a
Author: Kevin Harwell <kharwell at digium.com>
Date:   Mon Jun 1 18:25:48 2020 -0500

    Compiler fixes for gcc 10


Specifically this portion:

```
 #define AST_DEFINE_APP_ARGS_TYPE(type, arglist) \
        struct type { \
                unsigned int argc; \
-               char *argv[0]; \
-               arglist \
+               union { \
+                       char *argv[sizeof(struct {arglist}) / sizeof(char *)]; \
+                       struct {arglist}; \
+               }; \
        }
 ```

And *only* that portion from the larger commit.

That way we can avoid introducing a count argument in the C++ case such that semantics in C and C++ remains the same.


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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ibb299334d527fcd2af2b023fe64925ecece77d6d
Gerrit-Change-Number: 15399
Gerrit-PatchSet: 1
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-Comment-Date: Wed, 10 Feb 2021 17:41:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210210/8fad0499/attachment.html>


More information about the asterisk-code-review mailing list