Re: ExceptionalCondition() return type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ExceptionalCondition() return type
Date
Msg-id 11903.1335466902@sss.pgh.pa.us
Whole thread Raw
In response to ExceptionalCondition() return type  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I came across this comment:
> /*
>  * ExceptionalCondition - Handles the failure of an Assert()
>  *
>  * Note: this can't actually return, but we declare it as returning int
>  * because the TrapMacro() macro might get wonky otherwise.
>  */

> But it seems to me that this can easily be fixed like shown below, which
> compiles without warnings.  Is there any problem with that?

Um ... you did not fix the comment.

> I noticed that the comment at TrapMacro suggests this usage pattern
>     #define foo(x) (AssertMacro(x != 0) && bar(x))
> but all actual uses of AssertMacro() chain it using the comma operator.

Should probably adjust that comment to suggest commas, too.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jameison Martin
Date:
Subject: Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap
Next
From: Andrew Dunstan
Date:
Subject: Re: Request to add options to tools/git_changelog