summaryrefslogtreecommitdiff
path: root/include/inspircd.h
diff options
context:
space:
mode:
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-30 02:48:54 +0000
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-30 02:48:54 +0000
commit58385dd458e927994957b6d603f7f9da3fc52e14 (patch)
tree70c39a58446bd4f60205a9c34cac78524a67dc54 /include/inspircd.h
parentbca70575cb3d58127f80d92a388b60b5f5ed2fde (diff)
Commit -Wformat=2 -Wmissing-format-attributes, printf-like functions in inspircd now get treated like printf (meaning compile-time check goodness) in GCC
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9217 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/inspircd.h')
-rw-r--r--include/inspircd.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 84995710d..9798af4f2 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -25,6 +25,12 @@
#undef ERROR
#endif
+#ifdef __GNUC__
+#define CUSTOM_PRINTF(STRING, FIRST) __attribute__((format(printf, STRING, FIRST)))
+#else
+#define CUSTOM_PRINTF(STRING, FIRST)
+#endif
+
// Required system headers.
#include <time.h>
#include <stdarg.h>
@@ -796,7 +802,7 @@ class CoreExport InspIRCd : public classbase
* @param text Format string of to write to the log
* @param ... Format arguments of text to write to the log
*/
- void Log(int level, const char* text, ...);
+ void Log(int level, const char* text, ...) CUSTOM_PRINTF(3, 4);
/** Output a log message to the ircd.log file
* The text will only be output if the current loglevel
@@ -821,7 +827,7 @@ class CoreExport InspIRCd : public classbase
* @param format Format string for the numeric
* @param ... Parameters for the format string
*/
- void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
+ void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
/** Quit a user for excess flood, and if they are not
* fully registered yet, temporarily zline their IP.