Re: [code] quick question.

From: Franco Gasperino (awe@CET.COM)
Date: 11/07/97


----------
> From: Kenneth G. Cavness <kcavness@PROXICOM.COM>
> To: CIRCLE@post.queensu.ca
> Subject: Re:  [code] quick question.
> Date: Friday, November 07, 1997 12:48 PM
>
> On Fri, 7 Nov 1997, Franco Gasperino wrote:
>
> > There is a beautiful debug library that i use all the time that is
standard
> > on all installs (or should be). Include this header in your .c file:
> >
> > #include <assert.h>
>
>
> Assert.h is a nice debug library -- for non-realtime programs. Assert
> has the bad problem of "crashing" the MUD if you use it. Instead, it
> is a better idea to do your own bug testing, and if something doesn't
> work right, print an error and either try to exit the MUD gracefully
> if possible or move on if it's not a completely horrible bug.
>

Most any assertion you will put in will be to check to see if the mud
will crash in an unrecoverable way anyway, and it is great to see
if array bounds are being overritten, if pointers are null, or anything
else fatal.
Most of what an assert could do could be found by tracing the core
dump, but it makes a very nice diagnostic message of a place to
start looking.
Combine them with #ifdef DEBUG's, and you can cut down termendously
on debugging time (of course, this is all from personal experience).

  Franco Gasperino
  Cutting Edge Communications
  509-444-INET
  http://www.cet.com/
  awe@cet.com

>
> --
> Kenneth G. Cavness
> ph#:+1-301-767-0977                 |   mailto:kcavness@proxicom.com
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST