0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 12:02:28 +02:00

Remove empty dummy functions

These functions seem to have been added to avoid MSVC compiler warnigns.
However nowadays, they trigger compiler warnings from Clang (e.g. when
using --disable-lzo and --disable-lz4):

src/openvpn/fdmisc.c
/Users/arne/oss/openvpn-git/src/openvpn/comp-lz4.c:315:1: error: unused
function 'dummy' [-Werror,-Wunused-function]
dummy(void)
^
1 error generated.

Testing with MSVC shows that removing these functions does not trigger
warnings with MSVC either.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210322102119.14322-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21787.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
Arne Schwabe 2021-03-22 11:21:19 +01:00 committed by Gert Doering
parent 5b8a1231b9
commit 1b71f8597f
12 changed files with 0 additions and 78 deletions

View File

@ -309,10 +309,4 @@ const struct compress_alg lz4v2_alg = {
lz4v2_compress,
lz4v2_decompress
};
#else /* if defined(ENABLE_LZ4) */
static void
dummy(void)
{
}
#endif /* ENABLE_LZ4 */

View File

@ -175,10 +175,4 @@ const struct compress_alg comp_stub_alg = {
stub_compress,
stub_decompress
};
#else /* if defined(USE_COMP) */
static void
dummy(void)
{
}
#endif /* USE_STUB */

View File

@ -1253,12 +1253,4 @@ err:
CAPI_DATA_free(cd);
return 0;
}
#else /* ifdef ENABLE_CRYPTOAPI */
#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void
dummy(void)
{
}
#endif
#endif /* _WIN32 */

View File

@ -436,10 +436,4 @@ fragment_wakeup(struct fragment_master *f, struct frame *frame)
/* delete fragments with expired TTLs */
fragment_ttl_reap(f);
}
#else /* ifdef ENABLE_FRAGMENT */
static void
dummy(void)
{
}
#endif /* ifdef ENABLE_FRAGMENT */

View File

@ -233,10 +233,4 @@ corrupt_gremlin(struct buffer *buf, int flags)
}
}
}
#else /* ifdef ENABLE_DEBUG */
static void
dummy(void)
{
}
#endif /* ifdef ENABLE_DEBUG */

View File

@ -265,10 +265,4 @@ const struct compress_alg lzo_alg = {
lzo_compress,
lzo_decompress
};
#else /* if defined(ENABLE_LZO) */
static void
dummy(void)
{
}
#endif /* ENABLE_LZO */

View File

@ -171,10 +171,4 @@ mbuf_dereference_instance(struct mbuf_set *ms, struct multi_instance *mi)
}
}
}
#else /* if P2MP */
static void
dummy(void)
{
}
#endif /* P2MP */

View File

@ -412,10 +412,4 @@ ntlm_phase_3(const struct http_proxy_info *p, const char *phase_2,
return ((const char *)make_base64_string2((unsigned char *)phase3,
phase3_bufpos, gc));
}
#else /* if NTLM */
static void
dummy(void)
{
}
#endif /* if NTLM */

View File

@ -318,12 +318,4 @@ perf_print_state(int lev)
}
gc_free(&gc);
}
#else /* ifdef ENABLE_PERFORMANCE_METRICS */
#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void
dummy(void)
{
}
#endif
#endif /* ifdef ENABLE_PERFORMANCE_METRICS */

View File

@ -1001,12 +1001,4 @@ cleanup:
pkcs11h_terminate();
gc_free(&gc);
}
#else /* if defined(ENABLE_PKCS11) */
#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
static void
dummy(void)
{
}
#endif
#endif /* ENABLE_PKCS11 */

View File

@ -1014,10 +1014,4 @@ plugin_return_print(const int msglevel, const char *prefix, const struct plugin_
}
}
#endif /* ifdef ENABLE_DEBUG */
#else /* ifdef ENABLE_PLUGIN */
static void
dummy(void)
{
}
#endif /* ENABLE_PLUGIN */

View File

@ -94,10 +94,4 @@ shaper_msg(struct shaper *s)
msg(M_INFO, "Output Traffic Shaping initialized at %d bytes per second",
s->bytes_per_second);
}
#else /* ifdef ENABLE_FEATURE_SHAPER */
static void
dummy(void)
{
}
#endif /* ENABLE_FEATURE_SHAPER */