work around daft warning

Alan Modra amodra@gmail.com
Fri May 18 05:49:00 GMT 2012


.../gas/config/tc-dlx.c: In function ‘s_proc’:
.../gas/config/tc-dlx.c:248:15: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]

	* config/tc-dlx.c (s_proc): Avoid warning about ignoring asprintf
	return value.

Index: gas/config/tc-dlx.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-dlx.c,v
retrieving revision 1.25
diff -u -p -r1.25 tc-dlx.c
--- gas/config/tc-dlx.c	17 May 2012 15:13:16 -0000	1.25
+++ gas/config/tc-dlx.c	18 May 2012 05:18:49 -0000
@@ -245,7 +245,10 @@ s_proc (int end_p)
 	  /* Missing entry point, use function's name with the leading
 	     char prepended.  */
 	  if (leading_char)
-	    asprintf (&label, "%c%s", leading_char, name);
+	    {
+	      if (asprintf (&label, "%c%s", leading_char, name))
+		{ /* Avoid warning */ }
+	    }
 	  else
 	    label = name;
 	}

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list