Re: More pgindent follies

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: More pgindent follies
Дата
Msg-id 14146.990623147@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: More pgindent follies  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: More pgindent follies  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Zeugswetter Andreas SB
Дата:
Сообщение: AW: AW: Plans for solving the VACUUM problem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: DROP CONSTRAINT patch