diff options
Diffstat (limited to 'lout')
-rw-r--r-- | lout/misc.hh | 14 |
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; |