Fix compiler warnings on Fedora 26 / GCC 7.

GCC 7 has added capability to produce warnings, this fixes most of those
warnings.  The specific warnings are disabled in a few places:

* app_voicemail.c: truncation of paths more than 4096 chars in many places.
* chan_mgcp.c: callid truncated to 80 chars.
* cdr.c: two userfields are combined to cdr copy, fix would break ABI.
* tcptls.c: ignore use of deprecated method SSLv3_client_method().

ASTERISK-27156 #close

Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
This commit is contained in:
Corey Farrell
2017-07-27 21:58:22 -04:00
committed by George Joseph
parent 0d58fefa30
commit 0f49e6ee2e
28 changed files with 94 additions and 82 deletions

View File

@@ -31,20 +31,21 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/_private.h" /* ast_ssl_init() */
#ifdef HAVE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/err.h>
#endif
#include <dlfcn.h>
#if defined(HAVE_OPENSSL) && \
!defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#include "asterisk/_private.h" /* ast_ssl_init() */
#include <dlfcn.h>
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#ifdef HAVE_OPENSSL
#define get_OpenSSL_function(func) do { real_##func = dlsym(RTLD_NEXT, __stringify(func)); } while(0)
static int startup_complete;
@@ -74,7 +75,6 @@ static void ssl_lock(int mode, int n, const char *file, int line)
}
}
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
int SSL_library_init(void)
{
#if defined(AST_DEVMODE)
@@ -116,9 +116,6 @@ void ERR_free_strings(void)
{
/* we can't allow this to be called, ever */
}
#endif /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */
#endif /* HAVE_OPENSSL */
/*!
* \internal
@@ -128,8 +125,6 @@ void ERR_free_strings(void)
*/
int ast_ssl_init(void)
{
#if defined(HAVE_OPENSSL) && defined(OPENSSL_VERSION_NUMBER) && \
(OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
unsigned int i;
int (*real_SSL_library_init)(void);
void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void));
@@ -194,7 +189,14 @@ int ast_ssl_init(void)
startup_complete = 1;
#endif /* HAVE_OPENSSL and its version < 1.1 */
return 0;
}
#else
int ast_ssl_init(void)
{
return 0;
}
#endif