This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

work around daft warning


.../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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]