summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon <ron@debian.org>2009-06-27 04:44:16 +0930
committerAustin Foxley <austinf@cetoncorp.com>2009-07-09 01:34:43 -0700
commit9d43e61a4ead177134bb32a8926e572712720506 (patch)
treeae09415bd8ece89827555889eac075e32e884936
parent90e074e3ddf9de2df44622d9e753a5a9db0220b8 (diff)
downloaduClibc-alpine-9d43e61a4ead177134bb32a8926e572712720506.tar.bz2
uClibc-alpine-9d43e61a4ead177134bb32a8926e572712720506.tar.xz
Add some missing printf/scanf format attributes
The gcc-4.4 documentation still suggests that the compiler will automatically do format checking for the standard format function prototypes, but it is now also barking warnings suggesting that we add them for this lot too. So added. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
-rw-r--r--include/stdio.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/stdio.h b/include/stdio.h
index dea839c5a..9336fe3cc 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -337,7 +337,8 @@ extern int printf (__const char *__restrict __format, ...);
libc_hidden_proto(printf)
/* Write formatted output to S. */
extern int sprintf (char *__restrict __s,
- __const char *__restrict __format, ...) __THROW;
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
libc_hidden_proto(sprintf)
/* Write formatted output to S from argument list ARG.
@@ -354,7 +355,8 @@ libc_hidden_proto(vfprintf)
extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
/* Write formatted output to S from argument list ARG. */
extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
- __gnuc_va_list __arg) __THROW;
+ __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
__END_NAMESPACE_STD
#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
@@ -410,16 +412,19 @@ __BEGIN_NAMESPACE_STD
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int fscanf (FILE *__restrict __stream,
- __const char *__restrict __format, ...) __wur;
+ __const char *__restrict __format, ...)
+ __attribute__ ((__format__ (__scanf__, 2, 3))) __wur;
libc_hidden_proto(fscanf)
/* Read formatted input from stdin.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern int scanf (__const char *__restrict __format, ...) __wur;
+extern int scanf (__const char *__restrict __format, ...)
+ __attribute__ ((__format__ (__scanf__, 1, 2))) __wur;
/* Read formatted input from S. */
extern int sscanf (__const char *__restrict __s,
- __const char *__restrict __format, ...) __THROW;
+ __const char *__restrict __format, ...)
+ __THROW __attribute__ ((__format__ (__scanf__, 2, 3)));
libc_hidden_proto(sscanf)
__END_NAMESPACE_STD