]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove empty dummy functions
authorArne Schwabe <arne@rfc2549.org>
Mon, 22 Mar 2021 10:21:19 +0000 (11:21 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 22 Mar 2021 10:43:33 +0000 (11:43 +0100)
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:
src/openvpn/comp-lz4.c
src/openvpn/compstub.c
src/openvpn/cryptoapi.c
src/openvpn/fragment.c
src/openvpn/gremlin.c
src/openvpn/lzo.c
src/openvpn/mbuf.c
src/openvpn/ntlm.c
src/openvpn/perf.c
src/openvpn/pkcs11.c
src/openvpn/plugin.c
src/openvpn/shaper.c

index 2168a783ba5884727936e7ba354d7a12874fc401..9a29b887f979b604e34944e60d279efdbc11562a 100644 (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 */
index 9123541b15a7858940c2448265f7c369acebcd67..1de683d01f8ea9caaef2bcb7bfe10bda979f3a1d 100644 (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 */
index 6c4df9e3eb896052a3828cac1a160cd575a31592..a992441bfa19255f495542907fc83ee85b37b23d 100644 (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 */
index 6df71d07876846bfa2094377e000c355757145fc..0a1b457e5490f0c4c979244fc3100262e6aa5473 100644 (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 */
index 3f2bded621a87bd674d55f20d8db5161d27e4a27..796f0526eb6322d5aa4c6476942c6e0b050a697a 100644 (file)
@@ -233,10 +233,4 @@ corrupt_gremlin(struct buffer *buf, int flags)
         }
     }
 }
-
-#else  /* ifdef ENABLE_DEBUG */
-static void
-dummy(void)
-{
-}
 #endif /* ifdef ENABLE_DEBUG */
index d053fedf03acd4af26f7ff6c769ea631cc542832..2864db1e38baaa31488f5612b5daeb2c0f6ba8f5 100644 (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 */
index 87faff089edeaeb11129a37baee2fcfd2313d76a..76f478b8cda8a0e1edabf143bed043b709f6f1df 100644 (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 */
index e3707484d593801945a1dc51e75401a25c38f67b..3abe3b7e3e8a70204b91faa09740eb2e02ccaef6 100644 (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 */
index d8823585b5713ee0155311c5f24e119e5ca63b21..40690fa0bff60a323375c39f88c1ed1c6fb3de65 100644 (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 */
index 524229180e4b6eef8dda24dd6c06215d6ecb7c82..d55f106ac438a0f7ab6a4e04bb1c922f3404f793 100644 (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 */
index 8b351c45abdbd5d72f3cb6efb46a09661de45037..234e92b9ce3fde1a85b3789fca160499b5ec75b2 100644 (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 */
index 62579840103e7a48d147b6e28459b51f84bbbaf4..57a242416b7e3d18085abc0092b90b94cc585b40 100644 (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 */