summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-01-20 18:37:26 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-01-20 18:37:26 +0000
commit90308bb752d2ae64a763d9eed2a324202a634895 (patch)
tree333ae66d27280cfa6d5d18b745a7490aa89148a2
parentd0363c3927ff08bf48c3a892f6e8ffa37f0e1fde (diff)
downloadcoreboot-90308bb752d2ae64a763d9eed2a324202a634895.tar.xz
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 <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3872 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--src/include/console/console.h2
1 files changed, 1 insertions, 1 deletions
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)