Re: More pgindent follies - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More pgindent follies
Date
Msg-id 14146.990623147@sss.pgh.pa.us
Whole thread Raw
In response to Re: More pgindent follies  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: More pgindent follies  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> 4. This breaking of a comment attached to a #define scares me.
>> 
>> ***************
>> *** 1691,1705 ****
>> 
>> #define FIXED_CHAR_SEL    0.04    /* about 1/25 */
>> #define CHAR_RANGE_SEL    0.25
>> ! #define ANY_CHAR_SEL    0.9        /* not 1, since it won't match end-of-string */
>> #define FULL_WILDCARD_SEL 5.0
>> #define PARTIAL_WILDCARD_SEL 2.0
>> 
>> --- 1718,1733 ----
>> 
>> #define FIXED_CHAR_SEL    0.04    /* about 1/25 */
>> #define CHAR_RANGE_SEL    0.25
>> ! #define ANY_CHAR_SEL    0.9        /* not 1, since it won't match
>> !                                  * end-of-string */
>> #define FULL_WILDCARD_SEL 5.0
>> #define PARTIAL_WILDCARD_SEL 2.0
>> 
>> ***************

> I don't see the problem here.  My assumption is that the comment is not
> part of the define, right?

Well, that's the question.  ANSI C requires comments to be replaced by
whitespace before preprocessor commands are detected/executed, but there
was an awful lot of variation in preprocessor behavior before ANSI.
I suspect there are still preprocessors out there that might misbehave
on this input --- for example, by leaving the text "* end-of-string */"
present in the preprocessor output.  Now we still go to considerable
lengths to support not-quite-ANSI preprocessors.  I don't like the idea
that all the work done by configure and c.h in that direction might be
wasted because of pgindent carelessness.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: AW: Plans for solving the VACUUM problem
Next
From: Bruce Momjian
Date:
Subject: Re: DROP CONSTRAINT patch