In modern gcc/clang, libasan (the address sanitizer runtime) exports a
weak definition of `dlopen` so that it can intercept certain flags. If
one tried to `./configure` with address sanitizer enabled, this would
cause AC_SEARCH_LIBS to conclude that dlopen doesn't require any link
flags to use. However libasan does not export `dlsym` and this caused
AC_CHECK_FUNC to fail because it didn't try linking with `-ldl`.
Outgoing servers are not added to the client hash until they reach
IsServer() status, so if they're unknown when they exit then don't
attempt to delete them.
commio.c:2244:11: warning: variable length array used [-Wvla]
commio.c:2253:29: warning: comparison of integers of different signs:
'unsigned int' and 'int' [-Wsign-compare]
This use of alloca(3) is okay-ish considering the corresponding function
`rb_recv_fd_buf()` already uses it too, for much the same purpose. Also
remove a redundant return statement.
If an IPv4 connection is dropped by the pre-callback, and there is a
pending IPv6 connection on the same listening socket then the retried
accept() will be unable to populate `st` because `addrlen` will be too
small. Also initialise `st` each time to avoid a clang static analysis
warning.
hash.c:714:36: warning: comparison of integers of different signs:
'uint32_t' (aka 'unsigned int') and 'int'
[-Wsign-compare]
(... and 1 more of the same)
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