From f1b4fdce818aab9b906dedbddcc0ac14c05443ae Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 24 Dec 2020 20:44:31 -0500 Subject: [PATCH] Make logger aware of format string so it gives warnings if format is malformed. --- include/logger.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/logger.hpp b/include/logger.hpp index 5255ead9..aa0cd40f 100644 --- a/include/logger.hpp +++ b/include/logger.hpp @@ -35,6 +35,7 @@ void destroy(); /** Do not use this function directly. Use the macros above. Thread-safe, meaning messages cannot overlap each other in the log. */ +__attribute__ ((format(printf, 5, 6))) void log(Level level, const char* filename, int line, const char* func, const char* format, ...); /** Returns whether the current log file failed to end properly, due to a possible crash. Must be called *before* init().