Index: extensions/app_diameap/diameap_tls.h
===================================================================
--- extensions/app_diameap/diameap_tls.h	(revision 1034)
+++ extensions/app_diameap/diameap_tls.h	(revision 1033)
@@ -40,26 +40,10 @@
 #define DIAMEAP_TLS_H_
 
- #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
-# 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
-#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
-     GCC_DIAG_PRAGMA(ignored x)
-#  define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
-# else
-#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x)
-#  define GCC_DIAG_ON(x)  GCC_DIAG_PRAGMA(warning x)
-# endif
-#else
-# define GCC_DIAG_OFF(x)
-# define GCC_DIAG_ON(x)
-#endif
-
-
 #include "diameap_defs.h"
 #include <gnutls/gnutls.h>
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 #include <errno.h>
 #include <pthread.h>
Index: extensions/app_diameap/libcrypt.h
===================================================================
--- extensions/app_diameap/libcrypt.h	(revision 1034)
+++ extensions/app_diameap/libcrypt.h	(revision 1033)
@@ -40,12 +40,12 @@
 #define LIBCRYPT_H_
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#include <gcrypt.h>
+#pragma GCC diagnostic pop
+#include <stdio.h>
+
 /* EAP-TLS*/
 #include "diameap_tls.h"
-
-GCC_DIAG_OFF("-Wdeprecated-declarations")
-#include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
-#include <stdio.h>
-
 
 
Index: extensions/app_diameap/plugins/eap_md5/eap_md5.c
===================================================================
--- extensions/app_diameap/plugins/eap_md5/eap_md5.c	(revision 1034)
+++ extensions/app_diameap/plugins/eap_md5/eap_md5.c	(revision 1033)
@@ -38,7 +38,8 @@
 
 #include "../../plugins.h"
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 
 #define CHALLENGE_LEN	16
Index: extensions/app_sip/app_sip.h
===================================================================
--- extensions/app_sip/app_sip.h	(revision 1034)
+++ extensions/app_sip/app_sip.h	(revision 1033)
@@ -39,7 +39,8 @@
 #include <stdlib.h>
 #include <stdio.h>
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 #include <string.h>
 #include <mysql.h>
Index: extensions/test_sip/test_sip.h
===================================================================
--- extensions/test_sip/test_sip.h	(revision 1034)
+++ extensions/test_sip/test_sip.h	(revision 1033)
@@ -39,7 +39,8 @@
 #include <stdlib.h>
 #include <stdio.h>
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 #include <string.h>
 #include <mysql.h>
Index: include/freeDiameter/libfdproto.h
===================================================================
--- include/freeDiameter/libfdproto.h	(revision 1034)
+++ include/freeDiameter/libfdproto.h	(revision 1033)
@@ -89,21 +89,4 @@
 #define _ATTRIBUTE_PRINTFLIKE_(_f,_v) __attribute__ ((format (printf, _f, _v)))
 #endif /* SWIG */
-
-/* Remove some deprecated warnings from some gnutls versions, when possible */
-#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
-# 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
-#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
-     GCC_DIAG_PRAGMA(ignored x)
-#  define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
-# else
-#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x)
-#  define GCC_DIAG_ON(x)  GCC_DIAG_PRAGMA(warning x)
-# endif
-#else
-# define GCC_DIAG_OFF(x)
-# define GCC_DIAG_ON(x)
-#endif
 
 /*============================================================*/
Index: libfdcore/config.c
===================================================================
--- libfdcore/config.c	(revision 1034)
+++ libfdcore/config.c	(revision 1033)
@@ -227,5 +227,6 @@
 
 #ifndef GNUTLS_VERSION_300
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif /* !GNUTLS_VERSION_300 */
 /* Parse the configuration file (using the yacc parser) */
@@ -599,5 +600,5 @@
 }
 #ifndef GNUTLS_VERSION_300
-GCC_DIAG_ON("-Wdeprecated-declarations")
+# pragma GCC diagnostic pop
 #endif /* !GNUTLS_VERSION_300 */
 
Index: libfdcore/core.c
===================================================================
--- libfdcore/core.c	(revision 1034)
+++ libfdcore/core.c	(revision 1033)
@@ -36,7 +36,8 @@
 #include "fdcore-internal.h"
 
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 
 /* The static configuration structure */
Index: libfdcore/sctps.c
===================================================================
--- libfdcore/sctps.c	(revision 1034)
+++ libfdcore/sctps.c	(revision 1033)
@@ -231,5 +231,6 @@
 /* Set the parameters of a session to use the appropriate fifo and stream information */
 #ifndef GNUTLS_VERSION_300
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+# 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)
@@ -251,5 +252,5 @@
 }
 #ifndef GNUTLS_VERSION_300
-GCC_DIAG_ON("-Wdeprecated-declarations")
+# pragma GCC diagnostic pop
 #endif /* !GNUTLS_VERSION_300 */
 
Index: libfdproto/dictionary_functions.c
===================================================================
--- libfdproto/dictionary_functions.c	(revision 1033)
+++ libfdproto/dictionary_functions.c	(revision 1035)
@@ -219,7 +219,12 @@
 char * fd_dictfct_UTF8String_dump(union avp_value * avp_value)
 {
-#define TRUNC_LEN	42 /* avoid very long strings */
-	char * ret = strndup((char *)avp_value->os.data, TRUNC_LEN); 
-	if (ret && (*ret != '\0')) {
+#define TRUNC_LEN	1024 /* avoid very long strings */
+	char * ret;
+	CHECK_MALLOC_DO( ret = malloc(TRUNC_LEN+2+3+1), return NULL );
+	*ret = '"';
+	strncpy(ret+1, (char *)avp_value->os.data, TRUNC_LEN);
+	/* be sure to have a nul-terminated string */
+	ret[TRUNC_LEN+1] = '\0';
+	if (ret[1] != '\0') {
 		/* We sanitize the returned string to avoid UTF8 boundary problem.
 		We do this whether the string is trucated at TRUNC_LEN or not, to avoid potential problem
@@ -227,5 +232,5 @@
 
 		char * end = strchr(ret, '\0');
-		
+		char * oldend = end;
 		while (end > ret) {
 			end--;
@@ -241,5 +246,10 @@
 			}
 		}
-	}	
+		if (strlen((char *)avp_value->os.data) > strlen(ret+1))
+			strcat(end, "...");
+		strcat(end, "\"");
+	} else {
+		*ret = '\0';
+	}
 	return ret;
 }
@@ -320,4 +330,6 @@
 {
 	char * ret;
+	time_t val;
+	struct tm conv;
 	CHECK_MALLOC_DO( ret = malloc(STR_LEN), return NULL );
 	if (avp_value->os.len != 4) {
@@ -325,6 +337,10 @@
 		return ret;
 	}
-	/* TODO: display the time as human-readable */
-	snprintf(ret, STR_LEN, "[TODO Time dump: 0x%02hhx%02hhx%02hhx%02hhx]", avp_value->os.data[0], avp_value->os.data[1], avp_value->os.data[2], avp_value->os.data[3]);
+	if (diameter_string_to_time_t(avp_value->os.data, avp_value->os.len, &val) != 0) {
+		snprintf(ret, STR_LEN, "[time conversion error]");
+		return ret;
+	}
+	gmtime_r(&val, &conv);
+	snprintf(ret, STR_LEN, "%d%02d%02dT%02d%02d%02d+00", conv.tm_year+1900, conv.tm_mon+1, conv.tm_mday, conv.tm_hour, conv.tm_min, conv.tm_sec);
 	return ret;
 }
Index: tests/tests.h
===================================================================
--- tests/tests.h	(revision 1034)
+++ tests/tests.h	(revision 1033)
@@ -47,7 +47,8 @@
 #include <pthread.h>
 #include <errno.h>
-GCC_DIAG_OFF("-Wdeprecated-declarations")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include <gcrypt.h>
-GCC_DIAG_ON("-Wdeprecated-declarations")
+#pragma GCC diagnostic pop
 
 /* Test timeout duration, unless -n is passed on the command line */
