mirror of
https://github.com/tailix/libkernaux.git
synced 2025-04-21 17:42:26 -04:00
Use "__attribute__((format(printf, _, _)))"
This commit is contained in:
parent
6cd969bf87
commit
01fcde0fcb
2 changed files with 8 additions and 7 deletions
|
@ -6,7 +6,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
void kernaux_console_print(const char *s);
|
||||
void kernaux_console_printf(const char *format, ...);
|
||||
void kernaux_console_printf(const char *format, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
void kernaux_console_putc(char c);
|
||||
void kernaux_console_puts(const char *s);
|
||||
void kernaux_console_write(const char *data, unsigned int size);
|
||||
|
|
|
@ -8,13 +8,13 @@ static const char *KernAux_Multiboot2_TagType_to_str(
|
|||
|
||||
static void KernAux_Multiboot2_Tag_MemoryMap_print(
|
||||
const struct KernAux_Multiboot2_Tag_MemoryMap *tag,
|
||||
void (*printf)(const char *format, ...)
|
||||
void (*printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
)
|
||||
__attribute__((nonnull));
|
||||
|
||||
static void KernAux_Multiboot2_Tag_ELFSymbols_print(
|
||||
const struct KernAux_Multiboot2_Tag_ELFSymbols *tag,
|
||||
void (*printf)(const char *format, ...)
|
||||
void (*printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
)
|
||||
__attribute__((nonnull));
|
||||
|
||||
|
@ -73,7 +73,7 @@ const char *KernAux_Multiboot2_TagType_to_str(
|
|||
|
||||
void KernAux_Multiboot2_print(
|
||||
const struct KernAux_Multiboot2 *const multiboot2,
|
||||
void (*const printf)(const char *format, ...)
|
||||
void (*const printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
) {
|
||||
printf("Multiboot 2 info\n");
|
||||
printf(" size: %u\n", multiboot2->total_size);
|
||||
|
@ -97,7 +97,7 @@ void KernAux_Multiboot2_print(
|
|||
|
||||
void KernAux_Multiboot2_TagBase_print(
|
||||
const struct KernAux_Multiboot2_TagBase *const tag_base,
|
||||
void (*const printf)(const char *format, ...)
|
||||
void (*const printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
) {
|
||||
if (!KernAux_Multiboot2_TagBase_is_valid(tag_base)) {
|
||||
return;
|
||||
|
@ -283,7 +283,7 @@ void KernAux_Multiboot2_TagBase_print(
|
|||
|
||||
void KernAux_Multiboot2_Tag_MemoryMap_print(
|
||||
const struct KernAux_Multiboot2_Tag_MemoryMap *const tag,
|
||||
void (*printf)(const char *format, ...)
|
||||
void (*printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
) {
|
||||
if (!KernAux_Multiboot2_Tag_MemoryMap_is_valid(tag)) {
|
||||
printf(" invalid!\n");
|
||||
|
@ -313,7 +313,7 @@ void KernAux_Multiboot2_Tag_MemoryMap_print(
|
|||
|
||||
void KernAux_Multiboot2_Tag_ELFSymbols_print(
|
||||
const struct KernAux_Multiboot2_Tag_ELFSymbols *const tag,
|
||||
void (*printf)(const char *format, ...)
|
||||
void (*printf)(const char *format, ...) __attribute__((format(printf, 1, 2)))
|
||||
) {
|
||||
if (!KernAux_Multiboot2_Tag_ELFSymbols_is_valid(tag)) {
|
||||
printf(" invalid!\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue