[Bf-committers] Klocwork source analysis

Mathias Panzenböck grosser.meister.morti at gmx.net
Sun Dec 3 16:08:26 CET 2006


Alexander Ewering wrote:
> On Sun, 3 Dec 2006, [ISO-8859-1] Mathias Panzenb?ck wrote:
> 
>> Maybe assert(ptr); would be a sufficient solution?
> 
> And what is that "assert()" supposed to do?
> 

Well, when a function which is not supposed to get a NULL pointer gets NULL, then there is obviously
something very wrong in the source! How can such a error be recovered? In most cases it can't!
So the best thing would be to give a back trace and shutdown blender (maybe *try* to save a backup
of the file, but do not overwrite the file, because of this error a corruption could be possible).
Maybe you can tell the user to send a (maybe automated) error report including this back trace and
maybe other informations to the blender developers (like amarok dose on seg.faults).

Therefore some kind of assert-function which does those things would be IMHO nice to have.


More information about the Bf-committers mailing list