]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
various: Fix GCC 11.2 compilation issues.
authorSean Bright <sean@seanbright.com>
Fri, 29 Oct 2021 15:05:18 +0000 (15:05 +0000)
committerSean Bright <sean@seanbright.com>
Fri, 29 Oct 2021 17:15:53 +0000 (12:15 -0500)
* Initialize some variables that are never used anyway.

* Use valid pointers instead of integers cast to void pointers when
  calling pthread_setspecific().

ASTERISK-29711 #close
ASTERISK-29713 #close

Change-Id: I8728cd6f2f4b28e0e48113c5da450b768c2a6683

main/channel.c
main/logger.c
utils/extconf.c

index c0e1686e1acd5e2d1e6dcc9ed93cef5f0fd53b78..419acb93be9192e0be3e25fec0e7e6e904a450c0 100644 (file)
@@ -10344,7 +10344,7 @@ static void channel_set_intercept_mode(int in_intercept_mode)
        int status;
 
        status = ast_threadstorage_set_ptr(&in_intercept_routine,
-               in_intercept_mode ? (void *) 1 : (void *) 0);
+               in_intercept_mode ? &(int) { 1 } : NULL);
        if (status) {
                ast_log(LOG_ERROR, "Failed to set dialplan intercept mode\n");
        }
index 6b0e76f45f676c6fa716a0a185eb3a7f9baf5457..126a74d83dc6f85b04e50c4644aeae6851994949 100644 (file)
@@ -2213,7 +2213,7 @@ void ast_log_safe(int level, const char *file, int line, const char *function, c
                return;
        }
 
-       if (ast_threadstorage_set_ptr(&in_safe_log, (void*)1)) {
+       if (ast_threadstorage_set_ptr(&in_safe_log, &(int) { 1 })) {
                /* We've failed to set the flag that protects against
                 * recursion, so bail. */
                return;
index afc893c48ff8c6e992e4721c0f3262eec5a070e4..2da33a82f0ae30246155883c160c80032306e670 100644 (file)
@@ -2863,8 +2863,8 @@ static struct ast_config *ast_config_internal_load(const char *filename, struct
 
 static struct ast_config *ast_config_internal_load(const char *filename, struct ast_config *cfg, int withcomments, const char *suggested_incl_file)
 {
-       char db[256];
-       char table[256];
+       char db[256] = "";
+       char table[256] = "";
        struct ast_config_engine *loader = &text_file_engine;
        struct ast_config *result;