Compiler fixes for gcc 10

This patch fixes a few compile warnings/errors that now occur when using gcc
10+.

Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.

Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
This commit is contained in:
Kevin Harwell
2020-06-01 18:25:48 -05:00
committed by Friendly Automation
parent 559fa0e89c
commit 3d1bf3c537
23 changed files with 122 additions and 89 deletions

View File

@@ -722,7 +722,7 @@ static void *dundi_precache_thread(void *data)
{
struct dundi_query_state *st = data;
struct dundi_ie_data ied;
struct dundi_hint_metadata hmd;
struct dundi_hint_metadata hmd = {0};
char eid_str[20];
ast_debug(1, "Whee, precaching '%s@%s' for '%s'\n", st->called_number, st->called_context,
@@ -3936,7 +3936,6 @@ int dundi_lookup(struct dundi_result *result, int maxret, struct ast_channel *ch
static void reschedule_precache(const char *number, const char *context, int expiration)
{
int len;
struct dundi_precache_queue *qe, *prev;
AST_LIST_LOCK(&pcq);
@@ -3948,16 +3947,16 @@ static void reschedule_precache(const char *number, const char *context, int exp
}
AST_LIST_TRAVERSE_SAFE_END;
if (!qe) {
len = sizeof(*qe);
len += strlen(number) + 1;
len += strlen(context) + 1;
if (!(qe = ast_calloc(1, len))) {
int len = sizeof(*qe);
int num_len = strlen(number) + 1;
int context_len = strlen(context) + 1;
if (!(qe = ast_calloc(1, len + num_len + context_len))) {
AST_LIST_UNLOCK(&pcq);
return;
}
strcpy(qe->number, number);
qe->context = qe->number + strlen(number) + 1;
strcpy(qe->context, context);
qe->context = qe->number + num_len + 1;
ast_copy_string(qe->context, context, context_len);
}
time(&qe->expiration);
qe->expiration += expiration;