From 90308bb752d2ae64a763d9eed2a324202a634895 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 20 Jan 2009 18:37:26 +0000 Subject: Check the printk format string against the matching arguments. We have this type of checking in the v3 code since ages, but v2 will happily compile any code with bogus printk format strings and/or parameters. This can cause real bugs and at least needs to emit a warning, if not an error. Go with a warning for now since most of the flagged format strings are wrong but harmless in a 32-bit x86 environment. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3872 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/include/console/console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/include/console/console.h b/src/include/console/console.h index 1707ee8f53..3e1607b2a7 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -27,7 +27,7 @@ extern struct console_driver console_drivers[]; extern struct console_driver econsole_drivers[]; extern int console_loglevel; -int do_printk(int msg_level, const char *fmt, ...); +int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); #define printk_emerg(fmt, arg...) do_printk(BIOS_EMERG ,fmt, ##arg) #define printk_alert(fmt, arg...) do_printk(BIOS_ALERT ,fmt, ##arg) -- cgit v1.2.3