[Openvpn-devel] error.c: remove unused crash() function

Message ID 20220813212040.113-1-lstipakov@gmail.com
State Accepted
Headers show
Series [Openvpn-devel] error.c: remove unused crash() function | expand

Commit Message

Lev Stipakov Aug. 13, 2022, 11:20 a.m. UTC
From: Lev Stipakov <lev@openvpn.net>

This has been added in 2006 and as of now not used.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 src/openvpn/error.c | 9 ---------
 src/openvpn/error.h | 5 -----
 2 files changed, 14 deletions(-)

Comments

Gert Doering Aug. 13, 2022, 10:47 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Dead code indeed.  And if we want to crash, we can do this without help!

Test compiled on Linux.

Your patch has been applied to the master branch.

commit 1e1ec038168f22afa584aea79a0323a9fdf45095
Author: Lev Stipakov
Date:   Sun Aug 14 00:20:40 2022 +0300

     error.c: remove unused crash() function

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220813212040.113-1-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24924.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/error.c b/src/openvpn/error.c
index 7cd35b17..c8c77358 100644
--- a/src/openvpn/error.c
+++ b/src/openvpn/error.c
@@ -808,15 +808,6 @@  msg_flags_string(const unsigned int flags, struct gc_arena *gc)
     return BSTR(&out);
 }
 
-#ifdef ENABLE_DEBUG
-void
-crash(void)
-{
-    char *null = NULL;
-    *null = 0;
-}
-#endif
-
 #ifdef _WIN32
 
 const char *
diff --git a/src/openvpn/error.h b/src/openvpn/error.h
index 972619fe..89adb3e6 100644
--- a/src/openvpn/error.h
+++ b/src/openvpn/error.h
@@ -220,11 +220,6 @@  __attribute__((__noreturn__))
     [!!sizeof(struct { int __error_if_negative : (expr) ? 2 : -1; })]
 #endif
 
-#ifdef ENABLE_DEBUG
-void crash(void);  /* force a segfault (debugging only) */
-
-#endif
-
 /* Inline functions */
 
 static inline bool