summaryrefslogtreecommitdiff
path: root/flower
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2015-05-12 19:01:57 +0200
committerDavid Kastrup <dak@gnu.org>2015-05-19 08:34:05 +0200
commita4cc910a3401d25bb94ff0ecb4dc18f681c71004 (patch)
tree550dd809beeb5a52534be8730752c456cfb9b114 /flower
parent818367a0c9b21501b0459e69f188591f5db0a0f5 (diff)
Issue 2787: Sanitize usage of -DDEBUG, -DNDEBUG and assert
The compiler option -DNDEBUG is no longer being used: -DNDEBUG disables the assert function, and assert is essentially stating that the program cannot useful continue if the assertion is not met. -DNDEBUG is basically an option for compiling an application to a limited amount of ROM when aborting with a diagnostic is not preferable to crashing. This is not the case for LilyPond. So expensive debugging options now are enabled with -DDEBUG instead. There is a new configure option --enable-checking defaulting to "off" for this now. At the current point of time, setting --disable-optimising also has the effect of enabling the checks: this will be retained until Patchy has been adapted to using --enable-checking.
Diffstat (limited to 'flower')
-rw-r--r--flower/include/pqueue.hh2
-rw-r--r--flower/include/std-string.hh2
-rw-r--r--flower/include/std-vector.hh2
3 files changed, 3 insertions, 3 deletions
diff --git a/flower/include/pqueue.hh b/flower/include/pqueue.hh
index 39e0cbe743..6f1ebc53b6 100644
--- a/flower/include/pqueue.hh
+++ b/flower/include/pqueue.hh
@@ -69,7 +69,7 @@ public:
}
void OK () const
{
-#ifndef NDEBUG
+#ifdef DEBUG
for (vsize i = 2; i <= size (); i++)
assert (compare (elt (i / 2), elt (i)) <= 0);
#endif
diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh
index ea65fe042e..651f3403a1 100644
--- a/flower/include/std-string.hh
+++ b/flower/include/std-string.hh
@@ -27,7 +27,7 @@
/*
leads to dubious crashes - libstdc++ bug?
*/
-#ifndef NDEBUG
+#ifdef DEBUG
#define _GLIBCXX_DEBUG 1
#endif
#endif
diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh
index bb2103235e..fae955854b 100644
--- a/flower/include/std-vector.hh
+++ b/flower/include/std-vector.hh
@@ -25,7 +25,7 @@
/*
leads to dubious crashes - libstdc++ bug?
*/
-#ifndef NDEBUG
+#ifdef DEBUG
#define _GLIBCXX_DEBUG 1
#endif
#endif