From 2bc99f2e6e3bd947d796dece73c825dd0b2922b1 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 30 Nov 2022 17:28:46 +0100 Subject: [PATCH] Make log __attribute__(format), so the compiler can warn us of bad format strings --- kernel/src/Log.h | 3 ++- kernel/src/main.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/src/Log.h b/kernel/src/Log.h index 6250a758..0c0b9ab8 100644 --- a/kernel/src/Log.h +++ b/kernel/src/Log.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include @@ -11,7 +12,7 @@ enum class LogLevel }; Result vlog(LogLevel level, const char* format, va_list ap); -Result log(LogLevel level, const char* format, ...); +Result log(LogLevel level, const char* format, ...) _format(2, 3); void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console); bool log_debug_enabled(); diff --git a/kernel/src/main.cpp b/kernel/src/main.cpp index bf0cf636..10e76567 100644 --- a/kernel/src/main.cpp +++ b/kernel/src/main.cpp @@ -33,6 +33,10 @@ Result init() to_dynamic_unit(MemoryManager::reserved(), buffer, sizeof(buffer)); kinfoln("Reserved memory: %s", buffer); + volatile char* p = (volatile char*)0xefe0f3445692d; + + *p = 7; + return {}; }