changeset 1033:000e1904074c

Fix a number of additional warnings
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 16 Apr 2013 11:45:52 +0800
parents 313c510b0d65
children f4a73a991623 2f989d1a21e9
files extensions/app_diameap/diameap_tls.h extensions/app_diameap/libcrypt.h extensions/app_diameap/plugins/eap_md5/eap_md5.c extensions/app_diameap/plugins/eap_tls/eaptls.l extensions/app_radgw/rgw_clients.c extensions/app_sip/app_sip.h extensions/test_sip/test_sip.h include/freeDiameter/libfdproto.h libfdcore/config.c libfdcore/core.c libfdcore/endpoints.c libfdcore/p_psm.c libfdcore/sctps.c libfdproto/dictionary_functions.c tests/tests.h
diffstat 15 files changed, 26 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/app_diameap/diameap_tls.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_diameap/diameap_tls.h	Tue Apr 16 11:45:52 2013 +0800
@@ -41,9 +41,10 @@
 
 #include "diameap_defs.h"
 #include <gnutls/gnutls.h>
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 #include <errno.h>
 #include <pthread.h>
 
--- a/extensions/app_diameap/libcrypt.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_diameap/libcrypt.h	Tue Apr 16 11:45:52 2013 +0800
@@ -39,9 +39,10 @@
 #ifndef LIBCRYPT_H_
 #define LIBCRYPT_H_
 
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 #include <stdio.h>
 
 /* EAP-TLS*/
--- a/extensions/app_diameap/plugins/eap_md5/eap_md5.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_diameap/plugins/eap_md5/eap_md5.c	Tue Apr 16 11:45:52 2013 +0800
@@ -37,9 +37,10 @@
 
 
 #include "../../plugins.h"
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 
 #define CHALLENGE_LEN	16
 
--- a/extensions/app_diameap/plugins/eap_tls/eaptls.l	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_diameap/plugins/eap_tls/eaptls.l	Tue Apr 16 11:45:52 2013 +0800
@@ -39,6 +39,7 @@
 /*Declarations and option settings*/
 %{
 #include <stdio.h>
+#include "eap_tls.h"
 #include "eaptls.tab.h"
 
 #define YY_USER_ACTION { 						\
--- a/extensions/app_radgw/rgw_clients.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_radgw/rgw_clients.c	Tue Apr 16 11:45:52 2013 +0800
@@ -912,7 +912,7 @@
 	struct rgw_client * prev = NULL, *new = NULL;
 	int ret;
 	
-	TRACE_ENTRY("%p %p %lu", ip_port, key, keylen);
+	TRACE_ENTRY("%p %p %zu", ip_port, key, keylen);
 	
 	CHECK_PARAMS( ip_port && key && *key && keylen );
 	CHECK_PARAMS( (ip_port->sa_family == AF_INET) || (ip_port->sa_family == AF_INET6) );
--- a/extensions/app_sip/app_sip.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/app_sip/app_sip.h	Tue Apr 16 11:45:52 2013 +0800
@@ -38,9 +38,10 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 #include <string.h>
 #include <mysql.h>
 #include "md5.h"
--- a/extensions/test_sip/test_sip.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/extensions/test_sip/test_sip.h	Tue Apr 16 11:45:52 2013 +0800
@@ -38,9 +38,10 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 #include <string.h>
 #include <mysql.h>
 
--- a/include/freeDiameter/libfdproto.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/include/freeDiameter/libfdproto.h	Tue Apr 16 11:45:52 2013 +0800
@@ -250,7 +250,8 @@
 #ifdef DEBUG
 /* A version of __FILE__ without the full path */
 static char * file_bname = NULL;
-#define __STRIPPED_FILE__	(file_bname ?: (file_bname = basename((char *)__FILE__)))
+static char * file_bname_init(char * full) { file_bname = basename(full); return file_bname; }
+#define __STRIPPED_FILE__	(file_bname ?: file_bname_init((char *)__FILE__))
 
 /* Boolean for tracing at a certain level */
 #define TRACE_BOOL(_level_) ( ((_level_) <= fd_g_debug_lvl) 					\
--- a/libfdcore/config.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdcore/config.c	Tue Apr 16 11:45:52 2013 +0800
@@ -226,6 +226,7 @@
 #endif /* GNUTLS_VERSION_300 */
 
 #ifndef GNUTLS_VERSION_300
+# pragma GCC diagnostic push
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif /* !GNUTLS_VERSION_300 */
 /* Parse the configuration file (using the yacc parser) */
@@ -598,7 +599,7 @@
 	return 0;
 }
 #ifndef GNUTLS_VERSION_300
-# pragma GCC diagnostic pop "-Wdeprecated-declarations"
+# pragma GCC diagnostic pop
 #endif /* !GNUTLS_VERSION_300 */
 
 
--- a/libfdcore/core.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdcore/core.c	Tue Apr 16 11:45:52 2013 +0800
@@ -35,9 +35,10 @@
 
 #include "fdcore-internal.h"
 
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic pop "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 
 /* The static configuration structure */
 static struct fd_config g_conf;
--- a/libfdcore/endpoints.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdcore/endpoints.c	Tue Apr 16 11:45:52 2013 +0800
@@ -63,7 +63,7 @@
 		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Current list:");
 		fd_ep_dump( 4, list );
 		TRACE_DEBUG(ANNOYING, "  DEBUG:fd_ep_add_merge  Adding:");
-		fd_log_debug("    %s {%s%s%s%s}", buf,
+		fd_log_debug("    %s {%s%s%s%s%s}", buf,
 				(flags & EP_FL_CONF) 	? "C" : "-",
 				(flags & EP_FL_DISC)	    ? "D" : "-",
 				(flags & EP_FL_ADV)	    ? "A" : "-",
--- a/libfdcore/p_psm.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdcore/p_psm.c	Tue Apr 16 11:45:52 2013 +0800
@@ -659,7 +659,7 @@
 		
 		/* At this point the message must have been fully handled already */
 		if (msg) {
-			fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: unhandled message.", peer->p_hdr.info.pi_diamid );
+			fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid );
 			fd_msg_free(msg);
 		}
 		
--- a/libfdcore/sctps.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdcore/sctps.c	Tue Apr 16 11:45:52 2013 +0800
@@ -230,6 +230,7 @@
 
 /* Set the parameters of a session to use the appropriate fifo and stream information */
 #ifndef GNUTLS_VERSION_300
+# pragma GCC diagnostic push
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif /* !GNUTLS_VERSION_300 */
 static void set_sess_transport(gnutls_session_t session, struct sctps_ctx *ctx)
@@ -250,7 +251,7 @@
 	return;
 }
 #ifndef GNUTLS_VERSION_300
-# pragma GCC diagnostic pop "-Wdeprecated-declarations"
+# pragma GCC diagnostic pop
 #endif /* !GNUTLS_VERSION_300 */
 
 /*************************************************************/
--- a/libfdproto/dictionary_functions.c	Tue Apr 16 11:18:59 2013 +0800
+++ b/libfdproto/dictionary_functions.c	Tue Apr 16 11:45:52 2013 +0800
@@ -278,7 +278,7 @@
     char *conv;
     /* XXX: 2036 fix */
     out += DIFF_EPOCH_TO_NTP;
-    CHECK_PARAMS( (out & 0xffffffff00000000) == 0);
+    CHECK_PARAMS( (out >> 32) == 0);
 
     CHECK_MALLOC(conv=(char *)malloc(5));
     
@@ -313,7 +313,7 @@
 	
 	CHECK_PARAMS( avp_value && interpreted );
 	
-	return diameter_string_to_time_t(avp_value->os.data, avp_value->os.len, interpreted);
+	return diameter_string_to_time_t((const char *)avp_value->os.data, avp_value->os.len, interpreted);
 }
 
 char * fd_dictfct_Time_dump(union avp_value * avp_value)
--- a/tests/tests.h	Tue Apr 16 11:18:59 2013 +0800
+++ b/tests/tests.h	Tue Apr 16 11:45:52 2013 +0800
@@ -46,9 +46,10 @@
 
 #include <pthread.h>
 #include <errno.h>
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#pragma GCC diagnostic pop
 
 /* Test timeout duration, unless -n is passed on the command line */
 #ifndef TEST_TIMEOUT
"Welcome to our mercurial repository"