]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
treewide-use-__printf-not-__attribute__formatprintf-fix
authorAndrew Morton <akpm@google.com>
Wed, 5 Oct 2011 00:43:29 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Oct 2011 06:49:40 +0000 (17:49 +1100)
After merging the akpm tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from arch/powerpc/boot/stdio.c:12:0:
arch/powerpc/boot/stdio.h:10:17: error: expected declaration specifiers or '...' before numeric constant
arch/powerpc/boot/stdio.h:10:20: error: expected declaration specifiers or '...' before numeric constant
arch/powerpc/boot/stdio.h:10:8: warning: return type defaults to 'int'
arch/powerpc/boot/stdio.h:10:8: warning: function declaration isn't a prototype
arch/powerpc/boot/stdio.h: In function '__printf':
arch/powerpc/boot/stdio.h:14:17: error: expected declaration specifiers or '...' before numeric constant
arch/powerpc/boot/stdio.h:14:20: error: expected declaration specifiers or '...' before numeric constant
arch/powerpc/boot/stdio.h:14:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
arch/powerpc/boot/stdio.h:16:12: error: storage class specified for parameter 'vsprintf'
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/boot/ps3.c
arch/powerpc/boot/stdio.h

index 7e3f94cc338dad95f70a23aad0c4ad9f6e31858a..9954d98871d061dfc9abb8c33fefcbbe00d8d2ea 100644 (file)
@@ -36,7 +36,8 @@ extern int lv1_get_repository_node_value(u64 in_1, u64 in_2, u64 in_3,
 #ifdef DEBUG
 #define DBG(fmt...) printf(fmt)
 #else
-static inline __printf(1, 2) int DBG(const char *fmt, ...) {return 0;}
+static inline int __attribute__ ((format (printf, 1, 2))) DBG(
+       const char *fmt, ...) {return 0;}
 #endif
 
 BSS_STACK(4096);
index 756fc04331c47136ef7a33f60c0cd72af96fd17a..adffc58412d4afcd8cf2e25c579fc1abcfe6a689 100644 (file)
@@ -7,11 +7,12 @@
 #define        EINVAL          22      /* Invalid argument */
 #define ENOSPC         28      /* No space left on device */
 
-extern __printf(1, 2) int printf(const char *fmt, ...);
+extern int printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 
 #define fprintf(fmt, args...)  printf(args)
 
-extern __printf(2, 3) int sprintf(char *buf, const char *fmt, ...);
+extern int sprintf(char *buf, const char *fmt, ...)
+       __attribute__((format(printf, 2, 3)));
 
 extern int vsprintf(char *buf, const char *fmt, va_list args);