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

@@ -98,6 +98,7 @@ static char *handle_cli_test_locales(struct ast_cli_entry *e, int cmd, struct as
ast_strftime(origlocalformat, sizeof(origlocalformat), "%c", &atm);
while ((dent = readdir(localedir))) {
size_t locallen;
size_t namelen;
if (dent->d_name[0] == '.') {
@@ -107,14 +108,17 @@ static char *handle_cli_test_locales(struct ast_cli_entry *e, int cmd, struct as
setlocale(LC_ALL, dent->d_name);
ast_strftime(localformat, sizeof(localformat), "%c", &atm);
locallen = strlen(localformat) + 1;
namelen = strlen(dent->d_name) + 1;
/* Store values */
if (!(tl = ast_calloc(1, sizeof(*tl) + strlen(localformat) + (namelen = strlen(dent->d_name)) + 2))) {
if (!(tl = ast_calloc(1, sizeof(*tl) + locallen + namelen))) {
continue;
}
strcpy(tl->name, dent->d_name); /* SAFE */
tl->localformat = tl->name + namelen + 1;
strcpy(tl->localformat, localformat); /* SAFE */
ast_copy_string(tl->name, dent->d_name, namelen); /* SAFE */
tl->localformat = tl->name + namelen;
ast_copy_string(tl->localformat, localformat, locallen); /* SAFE */
AST_LIST_INSERT_TAIL(&locales, tl, list);