From 8acb4fbd1eae20ae86105a0ad05a0b928ed8ca10 Mon Sep 17 00:00:00 2001 From: Jaco Kroon Date: Wed, 24 Feb 2021 20:34:36 +0200 Subject: [PATCH] app.h: Fix -Werror=zero-length-bounds compile errors in dev mode. Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31 Signed-off-by: Jaco Kroon --- include/asterisk/app.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 6323287fcc..7690364f6d 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -1215,7 +1215,7 @@ int ast_app_group_list_unlock(void); 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 @@ int ast_app_group_list_unlock(void); */ #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 }; \ + }; \ } /*!