diff mbox series

[U-Boot,18/21] log: Check printf() arguments

Message ID 20181124042944.239106-19-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show
Series Various patches for verified boot support | expand

Commit Message

Simon Glass Nov. 24, 2018, 4:29 a.m. UTC
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 <sjg@chromium.org>
---

 include/log.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass Dec. 28, 2018, 8:47 p.m. UTC | #1
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 <sjg@chromium.org>
---

 include/log.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm/master, thanks!
diff mbox series

Patch

diff --git a/include/log.h b/include/log.h
index 4f14937b7a2..310b2cf7ce5 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