aboutsummaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
authorcorvid, Sebastian Geerken <devnull@localhost>2014-07-19 11:57:39 +0200
committercorvid, Sebastian Geerken <devnull@localhost>2014-07-19 11:57:39 +0200
commitf2a6892bc240c3a177ea98de50467b74f3fb18b7 (patch)
treeec2d4f19116f2f47c67ca2fe4a080335e6e052b3 /lout
parent627abe06cd649cbd42dca9883e2c0a1e2b3ee9b0 (diff)
Fixed compiler warning.
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;