aboutsummaryrefslogtreecommitdiff
path: root/lout/misc.hh
diff options
context:
space:
mode:
authorcorvid, Sebastian Geerken <devnull@localhost>2014-07-19 22:18:03 +0200
committercorvid, Sebastian Geerken <devnull@localhost>2014-07-19 22:18:03 +0200
commitd18714d72e745ea29ea5dca14b37da0944bb06bf (patch)
treecf3f056c9fe9a582e0cd8a7dbac1313cd8db4a6c /lout/misc.hh
parent3557cfec52950ac759d0e1b732ebc718553f2e9e (diff)
parentf2a6892bc240c3a177ea98de50467b74f3fb18b7 (diff)
Merge with main repo.
Diffstat (limited to 'lout/misc.hh')
-rw-r--r--lout/misc.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/lout/misc.hh b/lout/misc.hh
index 4c20208a..cac3da77 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -437,7 +437,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;