[Asterisk-code-review] app.h: Fix -Werror=zero-length-bounds compile errors in dev mode. (asterisk[18])
Joshua Colp
asteriskteam at digium.com
Wed Mar 10 04:24:28 CST 2021
Hello Jaco Kroon,
I'd like you to do a code review. Please visit
https://gerrit.asterisk.org/c/asterisk/+/15609
to review the following change.
Change subject: app.h: Fix -Werror=zero-length-bounds compile errors in dev mode.
......................................................................
app.h: Fix -Werror=zero-length-bounds compile errors in dev mode.
Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31
Signed-off-by: Jaco Kroon <jaco at uls.co.za>
---
M include/asterisk/app.h
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/09/15609/1
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 6323287..7690364 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -1215,7 +1215,7 @@
ast_app_separate_args() will perform that function before parsing
the arguments.
*/
-#define AST_DECLARE_APP_ARGS(name, arglist) AST_DEFINE_APP_ARGS_TYPE(, arglist) name = { 0, }
+#define AST_DECLARE_APP_ARGS(name, arglist) AST_DEFINE_APP_ARGS_TYPE(argtype_##name, arglist) name = { 0, }
/*!
\brief Define a structure type to hold an application's arguments.
@@ -1233,10 +1233,13 @@
*/
#define AST_DEFINE_APP_ARGS_TYPE(type, arglist) \
+ struct __subtype_##type { arglist }; \
struct type { \
unsigned int argc; \
- char *argv[0]; \
- arglist; \
+ union { \
+ char *argv[sizeof(struct __subtype_##type) / sizeof(char*)]; \
+ struct { arglist }; \
+ }; \
}
/*!
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15609
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31
Gerrit-Change-Number: 15609
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210310/5701f6ad/attachment.html>
More information about the asterisk-code-review
mailing list