9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b27c075e7d085b01600c2ba99083bd232eab0867
parent 2b2201b26db99dfff9874fcbdb74ab07a839abf1
Author: Roberto Vargas <roberto.vargas@arm.com>
Date:   Mon, 22 Oct 2018 09:11:48 +0100

[libc] Add printf attribute to printk

Diffstat:
Minclude/rcode.h | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/rcode.h b/include/rcode.h @@ -2,6 +2,12 @@ #include <stddef.h> #include <stdint.h> +#if __GNUC__ || __clang__ +#define PRINTKFMT __attribute__ ((format (printf, 1, 2))) +#else +#define PRINTKFMT +#endif + #ifndef NDEBUG #define dbg printk #else @@ -126,7 +132,7 @@ extern void trap(struct trapframe *fp); extern void badcmd(int error); extern void dopanic(void); extern void panic(const char *msg); -extern void printk(const char * restrict fmt, ...); +extern void printk(const char * restrict fmt, ...) PRINTKFMT; extern void rmc(Rmucmd *cmd); extern void swtch(struct trapframe *fp);