aboutsummaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
Diffstat (limited to 'lout')
-rw-r--r--lout/misc.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/lout/misc.hh b/lout/misc.hh
index 3082f33c..5aafd018 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -429,7 +429,19 @@ public:
assert (i >= 0);
return this->arrayMain + i;
} else if (i >= this->startExtra + this->numExtra) {
- assert (i < this->numMain + this->numExtra);
+ // The original assertion
+ ///
+ // "assert (i < this->numMain + this->numExtra)"
+ //
+ // causes this warnung in dw::Textblock::breakAdded:
+ //
+ // "assuming signed overflow does not occur when assuming that
+ // (X - c) > X is always false [-Wstrict-overflow]"
+ //
+ // Subtracting numExtra from both sides solves this,
+ // interrestingly.
+
+ assert (i - this->numExtra < this->numMain);
return this->arrayMain + i - this->numExtra;
} else
return this->arrayExtra1 + i - this->startExtra;