diff options
author | Haru <haru@dotalux.com> | 2014-08-07 03:39:13 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-08-07 05:37:38 +0200 |
commit | c45e3fa9793a273a0eab40d1626bcda7d710552c (patch) | |
tree | 4f6c9d47770a15c8cbfe065f7ee9203f77e57022 /src/common/showmsg.h | |
parent | caf89724767465ecf339c391bb6d7a937d563fb2 (diff) | |
download | hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.gz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.bz2 hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.xz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.zip |
Corrected several format-string errors through the code
- Functions that expect a printf-style format string are now marked as
such, so that gcc/clang will emit a warning warn you if you mismatch
format string and arguments.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/showmsg.h')
-rw-r--r-- | src/common/showmsg.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 83eb0ad89..4300c29d6 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -93,26 +93,26 @@ enum msg_type { extern void ClearScreen(void); #ifdef HERCULES_CORE - extern void ShowMessage(const char *, ...); - extern void ShowStatus(const char *, ...); - extern void ShowSQL(const char *, ...); - extern void ShowInfo(const char *, ...); - extern void ShowNotice(const char *, ...); - extern void ShowWarning(const char *, ...); - extern void ShowDebug(const char *, ...); - extern void ShowError(const char *, ...); - extern void ShowFatalError(const char *, ...); - extern void ShowConfigWarning(config_setting_t *config, const char *string, ...); + extern void ShowMessage(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowStatus(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowSQL(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowInfo(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowNotice(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowWarning(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowDebug(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowError(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowFatalError(const char *, ...) __attribute__((format(printf, 1, 2))); + extern void ShowConfigWarning(config_setting_t *config, const char *string, ...) __attribute__((format(printf, 2, 3))); #else - HPExport void (*ShowMessage) (const char *, ...); - HPExport void (*ShowStatus) (const char *, ...); - HPExport void (*ShowSQL) (const char *, ...); - HPExport void (*ShowInfo) (const char *, ...); - HPExport void (*ShowNotice) (const char *, ...); - HPExport void (*ShowWarning) (const char *, ...); - HPExport void (*ShowDebug) (const char *, ...); - HPExport void (*ShowError) (const char *, ...); - HPExport void (*ShowFatalError) (const char *, ...); + HPExport void (*ShowMessage) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowStatus) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowSQL) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowInfo) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowNotice) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowWarning) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowDebug) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowError) (const char *, ...) __attribute__((format(printf, 1, 2))); + HPExport void (*ShowFatalError) (const char *, ...) __attribute__((format(printf, 1, 2))); #endif extern int vShowMessage_(enum msg_type flag, const char *string, va_list ap); |