[Openvpn-devel,v1] Fix compiler warning in reliable.c with --disable-debug

Message ID 20250711100405.240625-1-frank@lichtenheld.com
State New
Headers show
Series [Openvpn-devel,v1] Fix compiler warning in reliable.c with --disable-debug | expand

Commit Message

Frank Lichtenheld July 11, 2025, 10:04 a.m. UTC
Use the easy way out. Using pre-compiler to completely
avoid n_active seems like overkill.

Change-Id: Icad1a52d14311a6f06bda081cab2f4bded8d47ed
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1082
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <arne-openvpn@rfc2549.org>

Comments

Gert Doering July 14, 2025, 9:21 a.m. UTC | #1
Interesting trick :-)

Looking forward to see the first patch come in to remove this "totally
useless line" again.  But that's what "git blame" is for...

Since the buildbots are happy and this line explicitly does nothing
I have not tested this further.

Your patch has been applied to the master branch.

commit fcd8f0f9fccdba02ed643dee5df7422ba36ced12
Author: Frank Lichtenheld
Date:   Fri Jul 11 12:04:05 2025 +0200

     Fix compiler warning in reliable.c with --disable-debug

     Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
     Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
     Message-Id: <20250711100405.240625-1-frank@lichtenheld.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32107.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/reliable.c b/src/openvpn/reliable.c
index 6aef112..424d194 100644
--- a/src/openvpn/reliable.c
+++ b/src/openvpn/reliable.c
@@ -648,6 +648,7 @@ 
             }
         }
     }
+    (void)n_active; /* dmsg might not generate code */
     dmsg(D_REL_DEBUG, "ACK reliable_can_send active=%d current=%d : %s",
          n_active,
          n_current,