mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Added __printf() attributes to printf-like functions
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
extern uint8_t console_loglevel;
|
||||
|
||||
// TODO: Add a ring buffer for the logs
|
||||
int printk(const char* fmt, ...);
|
||||
int printk(const char* fmt, ...) __printf(1, 2);
|
||||
int vprintk(const char* fmt, va_list ap);
|
||||
|
||||
#define pr_emerg(fmt, ...) printk(KERN_EMERG fmt, ##__VA_ARGS__)
|
||||
@@ -80,7 +80,7 @@ int vprintk(const char* fmt, va_list ap);
|
||||
|
||||
#define PANIC_MSG_BUFSZ 1024
|
||||
|
||||
void panic(const char* fmt, ...) __noreturn __cold;
|
||||
void panic(const char* fmt, ...) __noreturn __cold __printf(1, 2);
|
||||
void vpanic(const char* fmt, va_list ap)__noreturn __cold;
|
||||
|
||||
extern uintptr_t __kernel_start, __kernel_text_start, __kernel_rodata_start, __kernel_data_start;
|
||||
|
||||
@@ -20,7 +20,7 @@ void serial_write(int dev, const char* buf, size_t len);
|
||||
void serial_puts(int dev, const char* s);
|
||||
void serial_cls(int dev);
|
||||
|
||||
int debugf(const char* fmt, ...);
|
||||
int debugf(const char* fmt, ...) __printf(1, 2);
|
||||
int vdebugf(const char* fmt, va_list args);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <kernel.h>
|
||||
|
||||
int snprintf(char *buf, size_t n, const char *fmt, ...);
|
||||
int snprintf(char *buf, size_t n, const char *fmt, ...) __printf(3, 4);
|
||||
int vsnprintf(char* buf, size_t n, const char* fmt, va_list ap);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user