Skip to contentSkip to conversation

Fix 'defined but not used' warnings with enable-small/disable-management

PATCH In review Arne Schwabe 2 participants 4 messages Feb 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Fix 'defined but not used' warnings with enable-small/disable-management

Some functions are only used when management is used or enable-small is not used. Fix the ifdefs to correctly also include these helper functions the ifdefs to avoid compile errors when using -Werror

---
 src/openvpn/multi.c   | 11 +++++------
 src/openvpn/options.c |  7 +++----
 2 files changed, 8 insertions(+), 10 deletions(-)
src/openvpn/multi.c +5 -6
index 6f7bb6f8..e7f2c697 100644
@@ -3653,6 +3653,11 @@ multi_close_instance_on_signal(struct multi_context *m, struct multi_instance *m
     multi_close_instance(m, mi, false);
 }
 
+/*
+ * Management subsystem callbacks
+ */
+#ifdef ENABLE_MANAGEMENT
+
 static void
 multi_signal_instance(struct multi_context *m, struct multi_instance *mi, const int sig)
 {
@@ -3660,12 +3665,6 @@ multi_signal_instance(struct multi_context *m, struct multi_instance *mi, const
     multi_close_instance_on_signal(m, mi);
 }
 
-/*
- * Management subsystem callbacks
- */
-
-#ifdef ENABLE_MANAGEMENT
-
 static void
 management_callback_status(void *arg, const int version, struct status_output *so)
 {
src/openvpn/options.c +3 -4
index 813d34c9..2538421b 100644
@@ -910,6 +910,8 @@ struct pull_filter_list
     struct pull_filter *tail;
 };
 
+#ifndef ENABLE_SMALL
+
 static const char *
 pull_filter_type_name(int type)
 {
@@ -931,8 +933,6 @@ pull_filter_type_name(int type)
     }
 }
 
-#ifndef ENABLE_SMALL
-
 #define SHOW_PARM(name, value, format) msg(D_SHOW_PARMS, "  " #name " = " format, (value))
 #define SHOW_STR(var)       SHOW_PARM(var, (o->var ? o->var : "[UNDEF]"), "'%s'")
 #define SHOW_STR_INLINE(var)    SHOW_PARM(var, \
@@ -1268,6 +1268,7 @@ dhcp_option_address_parse(const char *name, const char *parm, in_addr_t *array,
 
 #endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */
 
+#ifndef ENABLE_SMALL
 static const char *
 print_vlan_accept(enum vlan_acceptable_frames mode)
 {
@@ -1285,8 +1286,6 @@ print_vlan_accept(enum vlan_acceptable_frames mode)
     return NULL;
 }
 
-#ifndef ENABLE_SMALL
-
 static void
 show_p2mp_parms(const struct options *o)
 {
Signature · 1 line
2.33.0
#1 lore raw

PATCH 2/2 Add Werror to github action ubuntu build

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.github/workflows/build.yaml +1 -1
index f1a75736..34d1dcce 100644
@@ -187,7 +187,7 @@ jobs:
       - name: autoconf
         run: autoreconf -fvi
       - name: configure
-        run: ./configure --with-crypto-library=${{matrix.ssllib}} ${{matrix.extraconf}}
+        run: ./configure --with-crypto-library=${{matrix.ssllib}} ${{matrix.extraconf}} --enable-werror
       - name: make all
         run: make -j3
       - name: make check
Signature · 1 line
2.33.0
Acked-by on v1 2/2
#2 lore raw

[Openvpn-devel] [PATCH applied] Re: Add Werror to github action ubuntu build

Makes sense. The code should be warning-free on Linux no, so enforce it.

(I seem to remember we already added this elsewhere for Linux CI builds)

Your patch has been applied to the master branch.

commit afa875bc7036edc78c89f4b2215deb0169807daa

Author: Arne Schwabe
Date:   Mon Feb 14 03:10:54 2022 +0100
     Add Werror to github action ubuntu build

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg23778.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

Acked-by on v1 1/2
#3 lore raw
In reply to Arne Schwabe

Ran across the print_vlan_accept() myself yesterday, but did not investigate
- so, very timely patch :-)

Onyl minimally compile tested.

Your patch has been applied to the master branch.

commit b0cbab96cc6e886d9eb8e304068ff61705d2a137

Author: Arne Schwabe
Date:   Mon Feb 14 03:10:53 2022 +0100
     Fix 'defined but not used' warnings with enable-small/disable-management

     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg23779.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering