Index: [thread] [date] [subject] [author]
  From: Steffen Seeger <s.seeger@physik.tu-chemnitz.de>
  To  : ggi-develop@eskimo.com
  Date: Mon, 12 Jul 1999 13:23:55 +0200 (CEST)

Re: hacking methods to find out bugs

> 
> 
> On Sun, 11 Jul 1999 mongoose@ms241739.users.mindspring.com wrote:
> 
> > 
> > Are you sure you're casting the data correctly then?  You mentioned you
> > shifted to void* from some_struct* type.  There could be a mistake in
> > casting ( like a typo ) where you're casting void* to some_sturct to
> > some_struct**.  
> > 
> 
> To make this sure, I've restructured it again last week. Could be that
> I've overseen one of this. What's the effecient method to find these bugs?

Strong type-checking. Sounds weird, but this (together with 
"gcc -c -W -Wall --pedantic") will help to spot most of the 'stupid' mistakes.

Second would be sanity checking. Whenever you enter a function, check that
the parameters are valid (you should do that for functions exported
anyway, however, for internal functions assertions would be a better choice.
Since I've started to use ASSERTions all over my code, the code 
detects itself if a strange things are going on. As they are macros, 
just compiling with a different debuglevel removes all debugging code.

However, this doesn't guarantee you don't have any bugs, but it
makes you to think about the allowed parameters, documents them in the code
and gives you a warning if something is wrong.

> Christoph Egger
> E-Mail: Christoph_Egger@t-online.de


			Steffen

----------------- e-mail: seeger@physik.tu-chemnitz.de -----------------

Index: [thread] [date] [subject] [author]