build: Fix a few gcc 13 issues

* gcc 13 is now catching when a function is declared as returning
  an enum but defined as returning an int or vice versa.  Fixed
  a few in app.h, loader.c, stasis_message.c.

* gcc 13 is also now (incorrectly) complaining of dangling pointers
  when assigning a pointer to a local char array to a char *. Had
  to change that to an ast_alloca.

Resolves: #155
This commit is contained in:
George Joseph
2023-06-09 08:41:32 -06:00
committed by asterisk-org-access-app[bot]
parent a207fe4900
commit 6b4f49c0df
4 changed files with 13 additions and 11 deletions

View File

@@ -130,9 +130,9 @@ AST_TEST_DEFINE(quoted_escape_test)
{
int res = AST_TEST_PASS;
const char *in = "a\"bcdefg\"hijkl\\mnopqrs tuv\twxyz";
char out[256] = { 0 };
char small[4] = { 0 };
int i;
#define LONG_SIZE 256
#define SHORT_SIZE 4
static struct {
char *buf;
@@ -140,14 +140,14 @@ AST_TEST_DEFINE(quoted_escape_test)
const char *output;
} tests[] = {
{0, sizeof(out),
{NULL, LONG_SIZE,
"a\\\"bcdefg\\\"hijkl\\\\mnopqrs tuv\twxyz"},
{0, sizeof(small),
{NULL, SHORT_SIZE,
"a\\\""},
};
tests[0].buf = out;
tests[1].buf = small;
tests[0].buf = ast_alloca(LONG_SIZE);
tests[1].buf = ast_alloca(SHORT_SIZE);
switch (cmd) {
case TEST_INIT:
@@ -171,6 +171,8 @@ AST_TEST_DEFINE(quoted_escape_test)
}
}
#undef LONG_SIZE
#undef SHORT_SIZE
return res;
}