Skip to contentSkip to conversation

error.c: remove unused crash() function

PATCH In review Lev Stipakov 2 participants 2 messages Aug 13, 2022 – Aug 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 error.c: remove unused crash() function

From: Lev Stipakov <[email protected]...>

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

---
 src/openvpn/error.c | 9 ---------
 src/openvpn/error.h | 5 -----
 2 files changed, 14 deletions(-)
src/openvpn/error.c +0 -9
index 7cd35b17..c8c77358 100644
@@ -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 *
src/openvpn/error.h +0 -5
index 972619fe..89adb3e6 100644
@@ -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
Signature · 1 line
2.23.0.windows.1
Acked-by on v1 1/1
#1 lore raw

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 <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24924.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering