!1014 Add __attribute__((format(printf, 2, 3)))

From: @zhangxiaokun9
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @ji_chen
pull/1014/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 3309250c36

@ -381,13 +381,13 @@ DLL_EXPORT void DlogFlush(void);
* @ingroup slog * @ingroup slog
* @brief Internal log interface, other modules are not allowed to call this interface * @brief Internal log interface, other modules are not allowed to call this interface
*/ */
void DlogErrorInner(int moduleId, const char *fmt, ...); void DlogErrorInner(int moduleId, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void DlogWarnInner(int moduleId, const char *fmt, ...); void DlogWarnInner(int moduleId, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void DlogInfoInner(int moduleId, const char *fmt, ...); void DlogInfoInner(int moduleId, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void DlogDebugInner(int moduleId, const char *fmt, ...); void DlogDebugInner(int moduleId, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void DlogEventInner(int moduleId, const char *fmt, ...); void DlogEventInner(int moduleId, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
void DlogInner(int moduleId, int level, const char *fmt, ...); void DlogInner(int moduleId, int level, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
void DlogWithKVInner(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...); void DlogWithKVInner(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
#ifdef __cplusplus #ifdef __cplusplus
#ifndef LOG_CPP #ifndef LOG_CPP
@ -500,8 +500,8 @@ DLL_EXPORT void DlogFlushForC(void);
* @ingroup slog * @ingroup slog
* @brief Internal log interface, other modules are not allowed to call this interface * @brief Internal log interface, other modules are not allowed to call this interface
*/ */
void DlogInnerForC(int moduleId, int level, const char *fmt, ...); void DlogInnerForC(int moduleId, int level, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
void DlogWithKVInnerForC(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...); void DlogWithKVInnerForC(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
#ifdef __cplusplus #ifdef __cplusplus
} }

Loading…
Cancel
Save