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:
parent
771dc573ee
commit
594dcaad19
2 changed files with 5 additions and 3 deletions
|
@ -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.
|
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);
|
return device_callback(device_pointer, (const char*) ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__attribute__((format(printf, 1, 2)))
|
||||||
inline size_t PrintF(const char* format, ...)
|
inline size_t PrintF(const char* format, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
@ -99,6 +100,7 @@ inline size_t PrintF(const char* format, ...)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__attribute__((format(printf, 1, 0)))
|
||||||
inline size_t PrintFV(const char* format, va_list list)
|
inline size_t PrintFV(const char* format, va_list list)
|
||||||
{
|
{
|
||||||
return vprintf_callback(device_callback, device_pointer, format, list);
|
return vprintf_callback(device_callback, device_pointer, format, list);
|
||||||
|
|
|
@ -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.
|
This file is part of Sortix.
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace Sortix {
|
||||||
|
|
||||||
extern "C" __attribute__((noreturn)) void HaltKernel();
|
extern "C" __attribute__((noreturn)) void HaltKernel();
|
||||||
extern "C" __attribute__((noreturn)) void Panic(const char* error);
|
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();
|
extern "C" void WaitForInterrupt();
|
||||||
|
|
||||||
} // namespace Sortix
|
} // namespace Sortix
|
||||||
|
|
Loading…
Reference in a new issue