lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: assert in page breaking


From: Joe Neeman
Subject: Re: assert in page breaking
Date: Wed, 24 Jan 2007 15:01:42 +0200

On 1/24/07, Han-Wen Nienhuys <address@hidden> wrote:
Joe Neeman escreveu:
> On 1/24/07, Han-Wen Nienhuys <address@hidden> wrote:
>> +  if (chunks.size () != div.size () + 1)
>> +    {
>> +      programming_error ("did not find a valid page breaking
>> configuration");
>> +      ignore_div = true;
>> +      assert (0);
>>
>>
>> this is better, but can we skip the assert()?
>
> If this assert fails, it's a bug in the page breaker. I personally
> prefer the assert because it means that if the bug appears during
> "make web," I will find it instead of it being lost in the output.
> This check really shouldn't depend on the validity of the user input
> -- there are plenty of other sanity checks along the way to test for
> that.

It will show up on  'make check', because it would cause a diff in the
logfile.

Is "make check" new or have I just missed it all this time? Just for
this, I'll remove the assert with no further complaints :)


>> The problem with assert is that it prevents people from getting a PDF
>> and looking at their score to see what the problem with it is.
>
> But the user builds are done with NDEBUG, right?

Yes, but does it degrade gracefully when the assert is not triggered?

Sort of. If the condition in the assert is false, it means that page
breaking has failed. I try to put together some sort of a solution but
it will probably overflow pages and all sorts of nasty stuff. I also
need to check whether the fact that there are the wrong number of
systems could cause a crash further down the line.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]