[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] master e6009c1 5/5: Demote an assertion to a con
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [lmi-commits] master e6009c1 5/5: Demote an assertion to a conditional |
Date: |
Mon, 30 Jul 2018 14:31:58 +0200 |
On Mon, 30 Jul 2018 07:23:16 -0400 (EDT) Greg Chicares <address@hidden> wrote:
GC> branch: master
GC> commit e6009c1c7d01b51386a11c8ced4b6a75d79b3bfc
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC>
GC> Demote an assertion to a conditional
GC>
GC> Replaced, in effect,
GC> assert(is_safe_to_execute_next_statement); foo();
GC> by
GC> if(is_safe_to_execute_next_statement) {foo();}
GC>
GC> The assertion has been observed to fail:
GC>
GC> https://lists.nongnu.org/archive/html/lmi/2018-07/msg00020.html
GC> | Assertion '0 <= ci.col_width - column_margin()' failed.
GC>
GC> and the obvious workaround is to bypass the block where it fails, so
GC> it really should be a conditional: if there's no room for an elastic
GC> column, then is should be omitted, silently.
I'm sorry but I don't understand at all the rationale for the last
statement. Is it really a good idea to silently generate wrong reports?
Because I don't see how could silently producing a report not showing the
names at all (I use names column as an example as it's is the only elastic
columns we have currently) could be considered a good outcome?
FWIW I do agree that there shouldn't be an assert here, because its
failure doesn't necessarily indicate a programmers error. But I do think we
should give an error, e.g. by throwing an exception, if this happens.
Sorry for bothering you, but this is rather important for me to understand
because I was quite sure that one of the main lmi goals was to never
produce incorrect output and am very surprised to see now a commit
explicitly going against this principle.
What am I missing?
VZ
- Re: [lmi] [lmi-commits] master e6009c1 5/5: Demote an assertion to a conditional,
Vadim Zeitlin <=