ratbox_lib.c:159:1: warning: function 'rb_lib_restart' could be declared
with attribute 'noreturn' [-Wmissing-noreturn]
ratbox_lib.c:220:1: warning: function 'rb_lib_loop' could be declared
with attribute 'noreturn' [-Wmissing-noreturn]
restart.c:55:1: warning: function 'server_reboot' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
core/m_server.c:138:3: warning: 'break' will never be executed
[-Wunreachable-code-break]
(... and 3 more of the same)
Why put an unreachable comment in the code *and then write a
statement following it* ? O_o
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.
modules.c:799:37: warning: cast from function call of type 'void *' to
non-matching type 'uintptr_t' (aka 'unsigned long')
[-Wbad-function-cast]
(... and 1 more of the same)
Redundant double-cast removed.
openssl.c:459:47: warning: cast from 'const char *' to 'char *' drops
const qualifier [-Wcast-qual]
(I find it remarkable that SSL_CTX_set1_curves_list() does not accept a
'const char *' argument...)
m_stats.c:181:22: warning: this function declaration is not a prototype
[-Wstrict-prototypes]
m_stats.c:1502:24: warning: format string is not a string literal
[-Wformat-nonliteral]
(... and 2 more of the same)
mkpasswd.c:516:1: warning: function 'full_usage' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
mkpasswd.c:537:1: warning: function 'brief_usage' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
crypt.c:49:4: warning: 'break' will never be executed
[-Wunreachable-code-break]
(... and 3 more of the same)
crypt.c:627:7: warning: variable 'f' may be uninitialized when used
here [-Wconditional-uninitialized]
crypt.c:539:12: note: initialize the variable 'f' to silence this
warning
ssld.c:1251:14: warning: signed shift result (0x80000000) sets the sign
bit of the shift expression's type ('int') and becomes
negative [-Wshift-sign-overflow]
ircd.c:125:1: warning: function 'ircd_shutdown' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
ircd.c:437:1: warning: function 'ircd_die_cb' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
bandb.c:243:1: warning: function 'error_cb' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
bandb.c:289:1: warning: function 'db_error_cb' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
bandb.c:293:13: warning: signed shift result (0x80000000) sets the sign
bit of the shift expression's type ('int') and becomes
negative [-Wshift-sign-overflow]
- Add (void) casts for unused function parameters
- Rearrange member in `struct rb_mbedtls_cfg_context' for data alignment
- Document a `clang-4.0 -Weverything' (-Wcast-qual) diagnostic
- Avoid pointless conversions between positive/negative error codes
- Use capital hexadecimals in error codes and properly cast to
(unsigned int) for %x/%X
strlcpy should be called with the size of the destination buffer, not
the length of the source string.
When the source is an empty string, the destination buffer isn't
written at all, resulting in it trying to output uninitialised data.
This could also cause a buffer overflow on very long invalid config
lines.