This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[LIBIBERTY]: Add printf attribute for vsnprintf declaration


Minor nit, the vsnprintf declaration should have a format attribute.

Also I made a whitespace change for vasprintf, it fits on one line
since PARAMS() was removed.  (Helps when using grep printf|grep -v
ATTRIBUTE_PRINTF in searching for missing attributes.)

Bootstrapped on x86_64-unknown-linux-gnu.

Okay for mainline?

		Thanks,
		--Kaveh


2005-05-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* libiberty.h (vsnprintf): Add format attribute.

diff -rup orig/egcc-CVS20050529/include/libiberty.h egcc-CVS20050529/include/libiberty.h
--- orig/egcc-CVS20050529/include/libiberty.h	2005-05-28 20:43:18.000000000 -0400
+++ egcc-CVS20050529/include/libiberty.h	2005-05-30 14:15:27.000000000 -0400
@@ -527,8 +527,7 @@ extern int asprintf (char **, const char
 /* Like vsprintf but provides a pointer to malloc'd storage, which
    must be freed by the caller.  */
 
-extern int vasprintf (char **, const char *, va_list)
-  ATTRIBUTE_PRINTF(2,0);
+extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0);
 #endif
 
 #if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF
@@ -538,7 +537,7 @@ extern int snprintf (char *, size_t, con
 
 #if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF
 /* Like vsprintf but prints at most N characters.  */
-extern int vsnprintf (char *, size_t, const char *, va_list);
+extern int vsnprintf (char *, size_t, const char *, va_list) ATTRIBUTE_PRINTF(3,0);
 #endif
 
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))


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