powerpc/xmon: Add __printf annotation to xmon_printf()
This allows the compiler to verify the format strings vs the types of the arguments. Update the other prototype declarations in asm/xmon.h. Silence warnings (triggered at W=1) by adding relevant __printf attribute. Move #define at bottom of the file to prevent conflict with gcc attribute. Solves the original warning: arch/powerpc/xmon/nonstdio.c:178:2: error: function might be possible candidate for ‘gnu_printf’ format attribute In turn this uncovered many formatting errors in xmon.c, all fixed in this patch. Signed-off-by: Mathieu Malaterre <malat@debian.org> [mpe: Always use px not p, fixup the 44x specific code, tweak change log] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
6671683db8
commit
e70d8f5526
@@ -1,13 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#define EOF (-1)
|
||||
|
||||
#define printf xmon_printf
|
||||
#define putchar xmon_putchar
|
||||
|
||||
extern void xmon_set_pagination_lpp(unsigned long lpp);
|
||||
extern void xmon_start_pagination(void);
|
||||
extern void xmon_end_pagination(void);
|
||||
extern int xmon_putchar(int c);
|
||||
extern void xmon_puts(const char *);
|
||||
extern char *xmon_gets(char *, int);
|
||||
extern void xmon_printf(const char *, ...);
|
||||
extern __printf(1, 2) void xmon_printf(const char *fmt, ...);
|
||||
|
||||
#define printf xmon_printf
|
||||
#define putchar xmon_putchar
|
||||
|
Reference in New Issue
Block a user