Re: Boatload of warnings in CVS HEAD :-( - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Boatload of warnings in CVS HEAD :-(
Date
Msg-id 20070504140321.GB28680@svana.org
Whole thread Raw
In response to Re: Boatload of warnings in CVS HEAD :-(  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: Boatload of warnings in CVS HEAD :-(  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Fri, May 04, 2007 at 02:18:31PM +0200, Zdenek Kotala wrote:
> Is the reason for keeping this in a code? Another kind of construct is:
>
> #define PG_RETURN_NULL()  \
>     do { fcinfo->isnull = true; return (Datum) 0; } while (0)

This is a standard way of getting multiple statements into a macro. If
the compiler complains, too bad, there isn't a standard alternative.

> for(;;) { ... break;} see e.g
> http://doxygen.postgresql.org/postgres_8c-source.html#l00198

So that within the loop you can use continue to start it again.

> or
> why is there while ... break instead if?
> http://doxygen.postgresql.org/comment_8c-source.html#l00221

Not sure about this one. It's not wrong, but it is unusual. Maybe
someone wanted to make it so that in the future it would handle
multiple cases?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Boatload of warnings in CVS HEAD :-(
Next
From: Alvaro Herrera
Date:
Subject: Re: Boatload of warnings in CVS HEAD :-(