diff options
author | Simon Glass <sjg@chromium.org> | 2019-01-07 16:44:19 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-01-14 17:47:13 -0700 |
commit | ed4e933d13c7242c643e4a535edf4d75c5322f94 (patch) | |
tree | de680d9295f0d872b74c215022986abe80e6b25b /include/log.h | |
parent | 0c89a318dc9abbdb74a9b57c5e7e4441d892b51a (diff) |
log: Check printf() arguments
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>
Diffstat (limited to 'include/log.h')
-rw-r--r-- | include/log.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 |