Added __printf() attributes to printf-like functions

This commit is contained in:
2026-03-28 18:03:46 +01:00
parent ad45de562a
commit f10f065e91
7 changed files with 12 additions and 18 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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