[Bf-committers] Using assert()?

Torsten Rupp torsten.rupp at gmx.net
Thu Aug 12 20:24:25 CEST 2010


Dear developers,

sometimes I see a SigSegV when using blender. When I'm able to 
reproduce the problem I try to trace it back. Sometimes it is a 
problem either with an array (to small or not initialized) or with 
some pointer. With other software projects I made good 
experiences to place assert() in the code to detect such problems 
early and and trace it back more easily instead of running into a 
SigSegV.

For example, it may be helpful to add an assert-check before accessing 
an array (check if array is not NULL and check the size) or 
deferencing a pointer. Also pre- and post-conditions may help to find 
bugs more easily.

I know there are already assert()-checks in the blender code. Were 
adding more assert()-code ever a discussion here?

Best regards,

Torsten


More information about the Bf-committers mailing list