Make log __attribute__(format), so the compiler can warn us of bad format strings
This commit is contained in:
parent
3f40ccd703
commit
2bc99f2e6e
@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <Attributes.h>
|
||||||
#include <Result.h>
|
#include <Result.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ enum class LogLevel
|
|||||||
};
|
};
|
||||||
|
|
||||||
Result<void> vlog(LogLevel level, const char* format, va_list ap);
|
Result<void> vlog(LogLevel level, const char* format, va_list ap);
|
||||||
Result<void> log(LogLevel level, const char* format, ...);
|
Result<void> log(LogLevel level, const char* format, ...) _format(2, 3);
|
||||||
|
|
||||||
void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console);
|
void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console);
|
||||||
bool log_debug_enabled();
|
bool log_debug_enabled();
|
||||||
|
@ -33,6 +33,10 @@ Result<void> init()
|
|||||||
to_dynamic_unit(MemoryManager::reserved(), buffer, sizeof(buffer));
|
to_dynamic_unit(MemoryManager::reserved(), buffer, sizeof(buffer));
|
||||||
kinfoln("Reserved memory: %s", buffer);
|
kinfoln("Reserved memory: %s", buffer);
|
||||||
|
|
||||||
|
volatile char* p = (volatile char*)0xefe0f3445692d;
|
||||||
|
|
||||||
|
*p = 7;
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user