changeset 1056:e330166422ba

Use the pragma outside the function
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 29 Apr 2013 12:30:07 +0800
parents 4387d1beff80
children 1c6c8fa622ff
files libfdproto/ostr.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libfdproto/ostr.c	Fri Apr 26 16:59:38 2013 +0200
+++ b/libfdproto/ostr.c	Mon Apr 29 12:30:07 2013 +0800
@@ -185,11 +185,12 @@
  if *inoutsz is != 0 on entry, *id may not be \0-terminated.
  memory has the following meaning: 0: *id can be realloc'd. 1: *id must be malloc'd on output (was static)
 */
+#if defined(DIAMID_IDNA_IGNORE) || defined(DIAMID_IDNA_REJECT)
+GCC_DIAG_OFF("-Wunused-but-set-variable")
+#endif
 int fd_os_validate_DiameterIdentity(char ** id, size_t * inoutsz, int memory)
 {
-GCC_DIAG_OFF("-Wunused-but-set-variable")
 	int gotsize = 0;
-GCC_DIAG_ON("-Wunused-but-set-variable")
 	
 	TRACE_ENTRY("%p %p", id, inoutsz);
 	CHECK_PARAMS( id && *id && inoutsz );
@@ -247,6 +248,9 @@
 	}
 	return 0;
 }
+#if defined(DIAMID_IDNA_IGNORE) || defined(DIAMID_IDNA_REJECT)
+GCC_DIAG_ON("-Wunused-but-set-variable")
+#endif
 
 /* Analyze a DiameterURI and return its components. 
   Return EINVAL if the URI is not valid. 
"Welcome to our mercurial repository"