From patchwork Sun Mar 21 23:21:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1651 X-Patchwork-Delegate: gert@greenie.muc.de Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id EKn0Lt9vWGBzWwAAIUCqbw (envelope-from ) for ; Mon, 22 Mar 2021 06:22:23 -0400 Received: from proxy17.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id gJb7Lt9vWGCjVwAAalYnBA (envelope-from ) for ; Mon, 22 Mar 2021 06:22:23 -0400 Received: from smtp32.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.ord1d.rsapps.net with LMTPS id KOWWLt9vWGCvJQAAWC7mWg (envelope-from ) for ; Mon, 22 Mar 2021 06:22:23 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp32.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 7cee94c6-8af8-11eb-87df-52540099eaf5-1-1 Received: from [216.105.38.7] ([216.105.38.7:46264] helo=lists.sourceforge.net) by smtp32.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EF/1C-04757-EDF68506; Mon, 22 Mar 2021 06:22:22 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lOHgm-0008Hg-F5; Mon, 22 Mar 2021 10:21:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lOHgh-0008HL-Mf for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 10:21:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E0aqnlbMppZDUbQRaAXwloTC90hpGjKTAQbEu15TzjI=; b=B0QuR5tJafbddRHsxOqaMt/Zkf S3tTwKtMt5eMyP+rBoo85z0JXNHjHvhBhN7eEtMS9rwN14lG3JLw7nnN/zMMVJTnnKSGxajWlWZmM s8l8gcZzJbtRu9cRf5OoMafAsK5FdgODzIsLQnjCQacY9eV0tOimH42AwPACOHMxQd1k=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=E0aqnlbMppZDUbQRaAXwloTC90hpGjKTAQbEu15TzjI=; b=a/ene9g5CwNOCP0QBvYeg68VjZ 6g6uu6FJFRY90/NJfAzrHQ612R6FhH8/OTIbDkxde+R/xOH7e5bBdB77KWURKjIPPxKoFz/kyj/z6 jA38t0U0UES8IbnnJkK4U+T4CaJq6u5GRLAGhQE/4sJVk4AvjGBHDvmdYfjuvFJiyGsE=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lOHgc-0008SU-BT for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 10:21:31 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lOHgV-0005wy-5A for openvpn-devel@lists.sourceforge.net; Mon, 22 Mar 2021 11:21:19 +0100 Received: (nullmailer pid 14366 invoked by uid 10006); Mon, 22 Mar 2021 10:21:19 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 22 Mar 2021 11:21:19 +0100 Message-Id: <20210322102119.14322-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lOHgc-0008SU-BT Subject: [Openvpn-devel] [PATCH] Remove empty dummy functions X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 Acked-by: Gert Doering --- src/openvpn/comp-lz4.c | 6 ------ src/openvpn/compstub.c | 6 ------ src/openvpn/cryptoapi.c | 8 -------- src/openvpn/fragment.c | 6 ------ src/openvpn/gremlin.c | 6 ------ src/openvpn/lzo.c | 6 ------ src/openvpn/mbuf.c | 6 ------ src/openvpn/ntlm.c | 6 ------ src/openvpn/perf.c | 8 -------- src/openvpn/pkcs11.c | 8 -------- src/openvpn/plugin.c | 6 ------ src/openvpn/shaper.c | 6 ------ 12 files changed, 78 deletions(-) diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c index 2168a783..9a29b887 100644 --- a/src/openvpn/comp-lz4.c +++ b/src/openvpn/comp-lz4.c @@ -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 */ diff --git a/src/openvpn/compstub.c b/src/openvpn/compstub.c index 9123541b..1de683d0 100644 --- a/src/openvpn/compstub.c +++ b/src/openvpn/compstub.c @@ -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 */ diff --git a/src/openvpn/cryptoapi.c b/src/openvpn/cryptoapi.c index 6c4df9e3..a992441b 100644 --- a/src/openvpn/cryptoapi.c +++ b/src/openvpn/cryptoapi.c @@ -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 */ diff --git a/src/openvpn/fragment.c b/src/openvpn/fragment.c index 6df71d07..0a1b457e 100644 --- a/src/openvpn/fragment.c +++ b/src/openvpn/fragment.c @@ -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 */ diff --git a/src/openvpn/gremlin.c b/src/openvpn/gremlin.c index 3f2bded6..796f0526 100644 --- a/src/openvpn/gremlin.c +++ b/src/openvpn/gremlin.c @@ -233,10 +233,4 @@ corrupt_gremlin(struct buffer *buf, int flags) } } } - -#else /* ifdef ENABLE_DEBUG */ -static void -dummy(void) -{ -} #endif /* ifdef ENABLE_DEBUG */ diff --git a/src/openvpn/lzo.c b/src/openvpn/lzo.c index d053fedf..2864db1e 100644 --- a/src/openvpn/lzo.c +++ b/src/openvpn/lzo.c @@ -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 */ diff --git a/src/openvpn/mbuf.c b/src/openvpn/mbuf.c index 87faff08..76f478b8 100644 --- a/src/openvpn/mbuf.c +++ b/src/openvpn/mbuf.c @@ -171,10 +171,4 @@ mbuf_dereference_instance(struct mbuf_set *ms, struct multi_instance *mi) } } } - -#else /* if P2MP */ -static void -dummy(void) -{ -} #endif /* P2MP */ diff --git a/src/openvpn/ntlm.c b/src/openvpn/ntlm.c index e3707484..3abe3b7e 100644 --- a/src/openvpn/ntlm.c +++ b/src/openvpn/ntlm.c @@ -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 */ diff --git a/src/openvpn/perf.c b/src/openvpn/perf.c index d8823585..40690fa0 100644 --- a/src/openvpn/perf.c +++ b/src/openvpn/perf.c @@ -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 */ diff --git a/src/openvpn/pkcs11.c b/src/openvpn/pkcs11.c index 52422918..d55f106a 100644 --- a/src/openvpn/pkcs11.c +++ b/src/openvpn/pkcs11.c @@ -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 */ diff --git a/src/openvpn/plugin.c b/src/openvpn/plugin.c index 8b351c45..234e92b9 100644 --- a/src/openvpn/plugin.c +++ b/src/openvpn/plugin.c @@ -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 */ diff --git a/src/openvpn/shaper.c b/src/openvpn/shaper.c index 62579840..57a24241 100644 --- a/src/openvpn/shaper.c +++ b/src/openvpn/shaper.c @@ -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 */