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-03 09:51:24 -05:00
committed by George Joseph
parent c7406a5b48
commit f59001d171
22 changed files with 124 additions and 89 deletions

View File

@@ -211,14 +211,10 @@ static const char *ast_str_substring(struct ast_str *value, int offset, int leng
}
if (length >= 0 && length < lr) { /* truncate if necessary */
char *tmp = ast_str_buffer(value);
tmp[length] = '\0';
ast_str_update(value);
ast_str_truncate(value, length);
} else if (length < 0) {
if (lr > -length) { /* After we remove from the front and from the rear, is there anything left? */
char *tmp = ast_str_buffer(value);
tmp[lr + length] = '\0';
ast_str_update(value);
ast_str_truncate(value, lr + length);
} else {
ast_str_reset(value);
}