[Ffmpeg-cvslog] r5740 - in trunk/libavutil: Makefile lls.c lls.h

Michael Niedermayer michaelni
Fri Jul 14 19:00:11 CEST 2006


Hi

On Fri, Jul 14, 2006 at 12:11:15PM -0400, Rich Felker wrote:
> On Fri, Jul 14, 2006 at 12:03:09PM +0200, michael wrote:
> > +#undef NDEBUG // allways check asserts, the speed effect is far too small to disable them
> > +#include <assert.h>
> 
> Yet there are no asserts in this file.

yes, ... ive already removed these 2 lines ...


> 
> Also I think this is inappropriate practice. There may be a reason
> that a caller does not want any chance of assert being called, or
> maybe doesn't even want assert linked in for whatever strange reason.

i think i diagree here, if a assert() fails then the following behavior
is random, after all the developer wrote that part of the code with the
strong belive his assert() would be true, so how can a failing assert()
be worse then completely undefined behavior (segfault, exploit, data loss,
...)


> Of course whenever you use assert it should be provable that the
> assert is never failable anyway, 

well, if i take that litterally then asserts where completely useless
because they could never fail ...
i would rather say that assert(x) is a statement from the developer that
he is certain that x is true, but he is just a human and might be wrong
either due to bugs, later changes or simple oversight of some corner case


> but the compiler is not a theorem
> prover and cannot solve the halting problem...

of course not ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-cvslog mailing list