From: Simon Glass Date: Mon, 7 Jan 2019 16:44:19 -0700 Subject: [U-Boot] [PATCH v2 2/7] log: Check printf() arguments In-Reply-To: <20190107234424.167742-1-sjg@chromium.org> References: <20190107234424.167742-1-sjg@chromium.org> Message-ID: <20190107234424.167742-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present logging does not check printf() arguments. Now that all users have been corrected, enable this to prevent further problems. Signed-off-by: Simon Glass --- Changes in v2: None include/log.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/log.h b/include/log.h index 0f2bc19477..d7f6471006 100644 --- a/include/log.h +++ b/include/log.h @@ -73,7 +73,8 @@ static inline int log_uc_cat(enum uclass_id id) * @return 0 if log record was emitted, -ve on error */ int _log(enum log_category_t cat, enum log_level_t level, const char *file, - int line, const char *func, const char *fmt, ...); + int line, const char *func, const char *fmt, ...) + __attribute__ ((format (__printf__, 6, 7))); /* Define this at the top of a file to add a prefix to debug messages */ #ifndef pr_fmt -- 2.20.1.97.g81188d93c3-goog