Assertions are good programming practice. However, as the recent assert I added shows us, they should not exist on the client side installations of our software. Assertions are meant for development use only.

Hence, I've added a new configure option, --disable-assert which will eliminate all assertions from the codebase before compilation.

A Note to Distro Maintainers:
=============================

I very highly recommend that you use the --disable-assert configuration option when compiling Wget. This is allow you to ensure that Wget does not fail with cryptic messages or for reasons that the end user cannot easily understand. Sometimes an assumption may fail, but the issue is not critical enough to cause Wget to crash. In such cases, disabling asserts will greatly improve user experience.

--
Thanking You,
Darshit Shah
From dfd652a252b871caa470a901ebcc62f577928e60 Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Sat, 15 Nov 2014 00:15:37 +0530
Subject: [PATCH 2/2] Add a configure option to disable assertions

Adds a --disable-assert configure option. We **highly recommend** the
use of this option by distro maintainers so as to ensure a smooth
experience with Wget. Sometimes an assertion may fail even though Wget
continues to work perfectly. In such scenarios, we do not wish for
client installations of Wget to crash. Hence, for a stable experience,
please use the --disable-assert configure flag.
---
 ChangeLog    | 3 +++
 NEWS         | 2 ++
 configure.ac | 7 +++++++
 3 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e9595f7..c5f2106 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2014-11-15  Darshit Shah  <[email protected]>
+	* configure.ac: Add AC_HEADER_ASSERT. Enables --disable-assert option
+
 2014-11-05  Tim Ruehsen <[email protected]>
 
 	* configure.ac: check for python3
diff --git a/NEWS b/NEWS
index 547d4e0..21905ef 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ Please send GNU Wget bug reports to <[email protected]>.
 
 * Changes in Wget X.Y.Z
 
+** Add --disable-assert configure option. Recommended for distro maintainers.
+
 ** Use pkg-config to check for libraries presence.
 
 
diff --git a/configure.ac b/configure.ac
index 7028481..eaa1356 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,13 @@ AC_DEFINE_UNQUOTED([OS_TYPE], "$host_os",
                    [Define to be the name of the operating system.])
 
 dnl
+dnl Add option to disable Assertions
+dnl
+dnl Adds a --disable-aasert option to ./configure which can be used by distro
+dnl maintainers to compile without assertions.
+AC_HEADER_ASSERT
+
+dnl
 dnl Process features.
 dnl
 
-- 
2.1.3

Attachment: pgp51a50SlG4w.pgp
Description: PGP signature

Reply via email to