> Date: Mon, 08 Sep 2003 09:57:30 -0400
> From: Tom Lane <[EMAIL PROTECTED]>
> 
> "Gaetano Mendola" <[EMAIL PROTECTED]> writes:
> > "Tom Lane" <[EMAIL PROTECTED]> 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 ...

What if define that if() as a macro? This would avoid the code bloat and allow
the paranoid users have the check if they want to. In analogy to "--cassert"
and "--debug", one could add a "--null-paranoid" option :) that would make
that macro defined. That would be no slowdown for non-paranoids and a friendly
error reporting for paranoids. Though I'm not sure if it is worthwhile of 
maintenance effort and falling back onto core dump would always "work".

-s


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to