Index: extensions/app_diameap/diameap_eap.c
===================================================================
--- extensions/app_diameap/diameap_eap.c	(revision 1027)
+++ extensions/app_diameap/diameap_eap.c	(revision 1052)
@@ -452,5 +452,5 @@
 							&eap_i->aaaEapEMSKData, &eap_i->aaaEapEMSKLength))
 					{
-						TRACE_DEBUG(INFO,"%s[EAP Protocol] Generating EAP Master Key failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname)
+						TRACE_DEBUG(INFO,"%s[EAP Protocol] [%s plugin] Generating EAP Master Key failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname)
 						eap_i->aaaEapMSKLength = 0;
 						eap_i->aaaEapEMSKLength = 0;
@@ -476,5 +476,5 @@
 					&eap_sm->currentVendor))
 			{
-				TRACE_DEBUG(INFO,"%s[EAP Protocol] Selecting EAP Method plugin failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname);
+				TRACE_DEBUG(INFO,"%s[EAP Protocol] [%s plugin] Selecting EAP Method plugin failed.",DIAMEAP_EXTENSION,eap_sm->selectedMethod->methodname);
 
 				*non_fatal_error = TRUE;
Index: extensions/app_diameap/diameap_plugins.c
===================================================================
--- extensions/app_diameap/diameap_plugins.c	(revision 1027)
+++ extensions/app_diameap/diameap_plugins.c	(revision 1052)
@@ -130,5 +130,5 @@
 		{
 			TRACE_DEBUG(INFO,
-					"%s[%s plugin] Unable to register EAP method.",DIAMEAP_EXTENSION,
+					"%s[%s plugin] Unable to register EAP method: %s.",DIAMEAP_EXTENSION,
 					plugin->methodname, dlerror());
 			return EINVAL;
Index: extensions/app_diameap/diameap_tls.h
===================================================================
--- extensions/app_diameap/diameap_tls.h	(revision 1034)
+++ extensions/app_diameap/diameap_tls.h	(revision 1052)
@@ -40,12 +40,12 @@
 #define DIAMEAP_TLS_H_
 
- #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
+#if defined(__GNUC__)
 # define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
 # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
-# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406		/* 4.6.x */
 #  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
      GCC_DIAG_PRAGMA(ignored x)
 #  define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
-# else
+# else							/* older */
 #  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x)
 #  define GCC_DIAG_ON(x)  GCC_DIAG_PRAGMA(warning x)
Index: extensions/app_radgw/radius.c
===================================================================
--- extensions/app_radgw/radius.c	(revision 1027)
+++ extensions/app_radgw/radius.c	(revision 1052)
@@ -251,5 +251,4 @@
 	unsigned char *pos;
 	u8 attrtype;
-	size_t offset = 0;
 	
 	memset(outbuf, 0, buflen);
Index: extensions/app_radgw/rgw_plugins.c
===================================================================
--- extensions/app_radgw/rgw_plugins.c	(revision 996)
+++ extensions/app_radgw/rgw_plugins.c	(revision 1052)
@@ -401,5 +401,4 @@
 	for (li = head->next; li != head; li = li->next) {
 		struct plg_descr * plg = ((struct plg_accel_item *) li)->plg;
-		int locstateful = 0;
 		
 		if (plg->descriptor->rgwp_diam_ans) {
Index: extensions/app_sip/registrationtermination.c
===================================================================
--- extensions/app_sip/registrationtermination.c	(revision 1027)
+++ extensions/app_sip/registrationtermination.c	(revision 1052)
@@ -98,5 +98,4 @@
 	struct msg * message=NULL;
 	struct avp *groupedavp=NULL, *avp=NULL;
-	struct session *sess=NULL;
 	union avp_value value;
 	
Index: extensions/rt_ignore_dh/rt_ignore_dh.c
===================================================================
--- extensions/rt_ignore_dh/rt_ignore_dh.c	(revision 1043)
+++ extensions/rt_ignore_dh/rt_ignore_dh.c	(revision 1052)
@@ -56,5 +56,4 @@
 	struct avp *oh_avp = NULL;
 	struct avp *pi_avp = NULL;
-	int match;
 	void *ps, *new_oh;
 	size_t ps_len, new_oh_len = 0;
@@ -67,4 +66,5 @@
 	while (avp && (!oh_avp || !pi_avp)) {
 		struct avp_hdr * ahdr;
+		int match = 0;
 		
 		CHECK_FCT(fd_msg_avp_hdr(avp, &ahdr));
@@ -77,8 +77,7 @@
 			case AC_PROXY_INFO:
 				ps = NULL;
-				match = ps_len = 0;
+				ps_len = 0;
 				CHECK_FCT(fd_msg_parse_dict(avp, fd_g_config->cnf_dict, NULL));
 				CHECK_FCT(fd_msg_browse(avp, MSG_BRW_FIRST_CHILD, &child, NULL));
-				int match = 0;
 				while (child && (!match || !ps)) {
 					struct avp_hdr *chdr;
Index: include/freeDiameter/libfdproto.h
===================================================================
--- include/freeDiameter/libfdproto.h	(revision 1038)
+++ include/freeDiameter/libfdproto.h	(revision 1052)
@@ -91,12 +91,12 @@
 
 /* Remove some deprecated warnings from some gnutls versions, when possible */
-#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
+#if defined(__GNUC__)
 # define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
 # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
-# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406		/* 4.6.x */
 #  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
      GCC_DIAG_PRAGMA(ignored x)
 #  define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
-# else
+# else							/* older */
 #  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x)
 #  define GCC_DIAG_ON(x)  GCC_DIAG_PRAGMA(warning x)
@@ -1915,4 +1915,8 @@
 int fd_sess_fromsid ( uint8_t * sid, size_t len, struct session ** session, int * isnew);
 
+/* only use the following in specific situations, e.g. app_radgw extension. They are normally handled by the framework only */
+int fd_sess_fromsid_msg ( uint8_t * sid, size_t len, struct session ** session, int * isnew); 
+int fd_sess_ref_msg ( struct session * session );
+
 /*
  * FUNCTION:	fd_sess_getsid
Index: libfdcore/p_sr.c
===================================================================
--- libfdcore/p_sr.c	(revision 1014)
+++ libfdcore/p_sr.c	(revision 1052)
@@ -78,6 +78,6 @@
 		
 		fd_log_debug(" - Next req (hbh:%x): [since %ld.%06ld sec]", *nexthbh, 
-			(now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1),
-			(now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_nsec - sr->added_on.tv_nsec) / 1000 : (now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000);
+			(long)((now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1)),
+			(long)((now.tv_nsec >= sr->added_on.tv_nsec) ? ((now.tv_nsec - sr->added_on.tv_nsec) / 1000) : ((now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000)));
 		
 		fd_msg_dump_one(ANNOYING + 1, sr->req);
Index: libfdproto/dictionary.c
===================================================================
--- libfdproto/dictionary.c	(revision 1050)
+++ libfdproto/dictionary.c	(revision 1052)
@@ -1180,5 +1180,5 @@
 					n = enumval->enum_value.os.len;
 				for (i=0; i < n; i++)
-					fd_log_debug("0x%02hhX/'%c' ", enumval->enum_value.os.data[i], ASCII(enumval->enum_value.os.data[i]));
+					fd_log_debug("0x%2hhX/'%c' ", enumval->enum_value.os.data[i], ASCII(enumval->enum_value.os.data[i]));
 				if (n == LEN_MAX)
 					fd_log_debug("...");
Index: libfdproto/dictionary_functions.c
===================================================================
--- libfdproto/dictionary_functions.c	(revision 1035)
+++ libfdproto/dictionary_functions.c	(revision 1052)
@@ -232,5 +232,4 @@
 
 		char * end = strchr(ret, '\0');
-		char * oldend = end;
 		while (end > ret) {
 			end--;
@@ -337,5 +336,5 @@
 		return ret;
 	}
-	if (diameter_string_to_time_t(avp_value->os.data, avp_value->os.len, &val) != 0) {
+	if (diameter_string_to_time_t((char *)avp_value->os.data, avp_value->os.len, &val) != 0) {
 		snprintf(ret, STR_LEN, "[time conversion error]");
 		return ret;
Index: libfdproto/fdproto-internal.h
===================================================================
--- libfdproto/fdproto-internal.h	(revision 1036)
+++ libfdproto/fdproto-internal.h	(revision 1052)
@@ -66,6 +66,4 @@
 
 /* Messages / sessions API */
-int fd_sess_fromsid_msg ( uint8_t * sid, size_t len, struct session ** session, int * new);
-int fd_sess_ref_msg ( struct session * session );
 int fd_sess_reclaim_msg ( struct session ** session );
 
