Re: Warnings in compile - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Warnings in compile
Date
Msg-id 5085.1243271787@sss.pgh.pa.us
Whole thread Raw
In response to Re: Warnings in compile  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
Michael Meskes <meskes@postgresql.org> writes:
> On Mon, May 25, 2009 at 12:10:49PM -0400, Tom Lane wrote:
>> Consider
>> 
>>    if (...)
>>        macro;
>>    else
>>        something-else;

> Sure, but some/most/all macros are called as 

> MACRO;

> No real reason there it seems.

Well, they are called that way right now.  The point of this discussion
is making the code safe against easily-foreseeable future changes.

Now, I'm privately of the opinion that those macros were a terrible idea
to begin with, because of the fact that they contain continue and break
statements; not only does that make them not act like self-contained
code, but they will break --- silently --- if anyone tries to put them
inside nested loops or switch statements.  However, that doesn't seem
nearly as likely as trying to put them inside if-statements; so I'll
just grumble to myself while insisting that we at least keep them safe
against that case.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)