[Asterisk-code-review] app.h: Fix -Werror=zero-length-bounds compile errors in dev mode. (asterisk[master])
Jaco Kroon
asteriskteam at digium.com
Wed Feb 24 12:36:16 CST 2021
Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15497 )
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/97/15497/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/+/15497
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31
Gerrit-Change-Number: 15497
Gerrit-PatchSet: 1
Gerrit-Owner: 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/20210224/97ec1157/attachment.html>
More information about the asterisk-code-review
mailing list