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
(cherry picked from commit 6c8b23a688)
This commit is contained in:
George Joseph
2023-06-09 08:41:32 -06:00
committed by Asterisk Development Team
parent 40ff67d636
commit ee09bbbb5f
4 changed files with 13 additions and 11 deletions

View File

@@ -1821,10 +1821,10 @@ prestart_error:
return res;
}
int ast_load_resource(const char *resource_name)
enum ast_module_load_result ast_load_resource(const char *resource_name)
{
struct ast_module *mod;
int res;
enum ast_module_load_result res;
/* If we're trying to load a module that previously declined to load,
* transparently unload it first so we dlclose, then dlopen it afresh.

View File

@@ -53,7 +53,7 @@ static void message_type_dtor(void *obj)
type->name = NULL;
}
int stasis_message_type_create(const char *name,
enum stasis_message_type_result stasis_message_type_create(const char *name,
struct stasis_message_vtable *vtable,
struct stasis_message_type **result)
{