This is the mail archive of the 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?


2005-05-30  Kaveh R. Ghazi  <>

	* 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)
+extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0);
@@ -538,7 +537,7 @@ extern int snprintf (char *, size_t, con
 /* 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);
 #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]