Re: mcxt.c - Mailing list pgsql-patches

From Gaetano Mendola
Subject Re: mcxt.c
Date
Msg-id 005801c3761b$40028f50$1f720b3e@mm.eutelsat.org
Whole thread Raw
In response to mcxt.c  ("Mendola Gaetano" <mendola@bigfoot.com>)
Responses Re: mcxt.c  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> "Gaetano Mendola" <mendola@bigfoot.com> writes:
> > "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> >> This seems inappropriate to me.  Are you going to suggest that every
> >> routine that takes a pointer parameter needs to explicitly test for
> >> null?
>
> > Of course I'm not suggesting this, what I'm suggesting is put an
> > assert( ) if the test can slow down the performances and an "if ( ) "
> > in places that are not going to touch the performances.
>
> I see no value at all in an assert.  The code will dump core just fine
> with or without an assert ...

Right but an assert can display information about the file and line number
without debug the application, without mention that reading the code with
the assert is clear what are the precondictions for a call function.



Regards
Gaetano Mendola

pgsql-patches by date:

Previous
From: "Gaetano Mendola"
Date:
Subject: Re: mcxt.c
Next
From: Bruce Momjian
Date:
Subject: Re: Minor lmgr code cleanup