From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Philipp Stephani wrote:
> I don't understand why minimizing the number of checks and asserti= ons
> should be a worthwhile goal. At the very least, the assertions documen= t the
> assumptions that we make about the values, and as such they are valuab= le
> even if they never trigger.
One can take the process too far. To take a deliberately extreme example, 'eassert (INT_MIN < 0)' would clutter the code unnecessarily, an= d would be
discarded by the compiler anyway. Although none of the assertions in questi= on
were *that* obvious, some did have that flavor (and indeed, were optimized = away
by GCC). The patch that I proposed eliminated those, while retaining the on= es
that conveyed useful and nonobvious information. Admittedly some of the rem= ovals
were judgment calls; however, the point remains that easserts should not wa= ste
the reader's time unnecessarily.