[postgis-devel] unite_array() error handling
dblasby at gmail.com
Mon Feb 7 09:34:57 PST 2005
"elog(ERROR,...)" causes the function to return, so the next line
"PG_RETURN_NULL()" never actually gets executed.
Unfortunately, the compiler isnt smart enough to know that its going
to return, so it will sometimes complain. Adding the
never-actually-executed "PG_RETURN_NULL()" makes the compiler happy.
On Mon, 07 Feb 2005 14:56:21 +0100, Markus Schaber
<schabios at logi-track.com> wrote:
> I just read in the unite_garray() code, and have a small question
> regarding the error handling. Should there be a call to PG_RETURN_NULL()
> added after the elog() call in line 238?
> if ( g2 == NULL )
> elog(ERROR,"GEOS union() threw an error!");
> here --> PG_RETURN_NULL();
> I'm not shure about the elog() sematics (is this a macro that
> automatically returns?), but some lines below, PG_RETURN_NULL() is called:
> if ( result == NULL )
> elog(ERROR, "GEOS2POSTGIS returned an error");
> PG_RETURN_NULL(); //never get here
> BTW, what's the exact meaning of //never get here? :-)
> I'm currently searching for good docs regarding writing PostgreSQL C
> extensions. Is the material in the official PG manual the only / best
> one available?
> markus schaber | dipl. informatiker
> logi-track ag | rennweg 14-16 | ch 8001 zürich
> phone +41-43-888 62 52 | fax +41-43-888 62 53
> mailto:schabios at logi-track.com | www.logi-track.com
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
More information about the postgis-devel