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>
12 files changed:
lz4v2_compress,
lz4v2_decompress
};
-
-#else /* if defined(ENABLE_LZ4) */
-static void
-dummy(void)
-{
-}
#endif /* ENABLE_LZ4 */
stub_compress,
stub_decompress
};
-
-#else /* if defined(USE_COMP) */
-static void
-dummy(void)
-{
-}
#endif /* USE_STUB */
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 */
/* delete fragments with expired TTLs */
fragment_ttl_reap(f);
}
-
-#else /* ifdef ENABLE_FRAGMENT */
-static void
-dummy(void)
-{
-}
#endif /* ifdef ENABLE_FRAGMENT */
}
}
}
-
-#else /* ifdef ENABLE_DEBUG */
-static void
-dummy(void)
-{
-}
#endif /* ifdef ENABLE_DEBUG */
lzo_compress,
lzo_decompress
};
-
-#else /* if defined(ENABLE_LZO) */
-static void
-dummy(void)
-{
-}
#endif /* ENABLE_LZO */
}
}
}
-
-#else /* if P2MP */
-static void
-dummy(void)
-{
-}
#endif /* P2MP */
return ((const char *)make_base64_string2((unsigned char *)phase3,
phase3_bufpos, gc));
}
-
-#else /* if NTLM */
-static void
-dummy(void)
-{
-}
#endif /* if NTLM */
}
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 */
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 */
}
}
#endif /* ifdef ENABLE_DEBUG */
-
-#else /* ifdef ENABLE_PLUGIN */
-static void
-dummy(void)
-{
-}
#endif /* ENABLE_PLUGIN */
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 */