Re: More pgindent follies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: More pgindent follies
Date: 2001-05-23 13:05:47
Message-ID: 14146.990623147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-05-23 15:19:54 Re: DROP CONSTRAINT patch
Previous Message Zeugswetter Andreas SB 2001-05-23 11:08:28 AW: AW: Plans for solving the VACUUM problem