1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Add format attribute to kernel print and panic functions.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-02-20 16:57:34 +01:00
parent 771dc573ee
commit 594dcaad19
2 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014.
This file is part of Sortix.
@ -90,6 +90,7 @@ inline size_t PrintData(const void* ptr, size_t size)
return device_callback(device_pointer, (const char*) ptr, size);
}
__attribute__((format(printf, 1, 2)))
inline size_t PrintF(const char* format, ...)
{
va_list list;
@ -99,6 +100,7 @@ inline size_t PrintF(const char* format, ...)
return result;
}
__attribute__((format(printf, 1, 0)))
inline size_t PrintFV(const char* format, va_list list)
{
return vprintf_callback(device_callback, device_pointer, format, list);

View file

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2013.
Copyright(C) Jonas 'Sortie' Termansen 2011, 2013, 2014.
This file is part of Sortix.
@ -29,7 +29,7 @@ namespace Sortix {
extern "C" __attribute__((noreturn)) void HaltKernel();
extern "C" __attribute__((noreturn)) void Panic(const char* error);
extern "C" __attribute__((noreturn)) void PanicF(const char* format, ...);
extern "C" __attribute__((noreturn, format(printf, 1, 2))) void PanicF(const char* format, ...);
extern "C" void WaitForInterrupt();
} // namespace Sortix