]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
include/s_user.h: misc cleanup for compiler warning
authorAaron Jones <redacted>
Mon, 31 Jul 2017 04:39:13 +0000 (04:39 +0000)
committerAaron Jones <redacted>
Fri, 4 Aug 2017 12:32:56 +0000 (12:32 +0000)
s_user.c:1428:26: warning: format string is not a string literal
                  [-Wformat-nonliteral]

Adding the printf attribute to the function will make the compiler
assume that the 'format' argument to the function is a string
literal (by warning about the *callers* of the function *not* using
a string literal), thus avoiding the warning in the function.

include/s_user.h

index 38fa7669bb9921f5c7ca9f1bc1b4ebad691b2ed2..b337e8bd1a618fe8e60e86d48df5611a6749353f 100644 (file)
@@ -47,7 +47,8 @@ extern int introduce_client(struct Client *client_p, struct Client *source_p,
                            struct User *user, const char *nick, int use_euid);
 
 extern void change_nick_user_host(struct Client *target_p, const char *nick, const char *user,
-                                 const char *host, int newts, const char *format, ...);
+                                 const char *host, int newts, const char *format, ...)
+                                 __attribute__((format(printf, 6, 7)));
 
 extern int user_modes[256];
 extern unsigned int find_umode_slot(void);