> >     //Origin message setup
> >     Message* originMessage;                 //message for origin
> >     assert(originMessage);
> Not surprising, really. Where's originMessage actually allocated? I'd 
> also double-check your assert function (macro?), since I don't think 
> it's working either (otherwise would have asserted there).
> 
> BTW, when it comes to pointers, it is a really, really, really good
> idea to either new/malloc them straight away, or assign them to 0 to
> force a null-pointer (not sure all compilers assign variables 0 by
> default).

Personally I think better advice is to READ THE COMPILER WARNINGS.  If
your compiler isn't printing warnings for uninitialised variables,
either change the flags, or get a new compiler.  Report spurious
warnings as bugs &/or fix them.  Your editor/IDE should take you to
warnings straight away so you have to look at the warnings.  If not,
change IDE/editor to one that does (vim or emacs).  I recommend use
-Werror for a while, to get in the habit of really culling warnings
down.  Aim for 0 warnings in all your code.

Use tools such as lint or sparse to find bugs before they bite you:
(http://www.kernel.org/pub/software/devel/sparse/).  Use valgrind &
memprof to find memory problems early in development.

As an aside, except static variables (initialised to a bit pattern of
all 0's - Not necessarily NULL for pointers), and array & structures in
certain cases, variables in C & C++ are all uinitialised.

        Regards,
        nash
_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to