From 961f79188f0483fe23bc7b5a4a9bad569ca9a0ec Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Mon, 24 Apr 2023 14:50:10 +0200 Subject: [PATCH] compile-time printf-warnings --- include/logger.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/logger.hh b/include/logger.hh index 4df119f..9678e8d 100644 --- a/include/logger.hh +++ b/include/logger.hh @@ -1,17 +1,17 @@ // This file is part of monofonIC (MUSIC2) // A software package to generate ICs for cosmological simulations // Copyright (C) 2020 by Oliver Hahn & Michael Michaux (this file) -// +// // monofonIC is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // monofonIC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program. If not, see . #pragma once @@ -127,7 +127,7 @@ public: return *this; } - inline void Print(const char *str, ...) { + inline void Print(const char *str, ...) __attribute__ ((format (printf, 2, 3))) { char out[1024]; va_list argptr; va_start(argptr, str);