Re: Fix pg_dump dependency on postgres.h

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix pg_dump dependency on postgres.h
Дата
Msg-id 25156.1195059055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fix pg_dump dependency on postgres.h  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Ответы Re: Fix pg_dump dependency on postgres.h  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список pgsql-patches
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> TYPE_IS_DECLARED was my mistake. It should be YYSTYPE_IS_DECLARED. It
> works because YYSTYPE is also defined and #ifdef checks both. Copy and
> paste :( error. Sorry for confusion. I'm going to send new version.

[ after further review... ]

It looks to me like the intended use of YYSTYPE_IS_DECLARED is to
denote the case where the user has supplied a typedef, not macro,
definition of YYSTYPE.  So defining YYSTYPE as a macro and setting
YYSTYPE_IS_DECLARED as well really seems incorrect.

The real question with all this is that while the Bison manual clearly
says that you can #define YYSTYPE, there is not anything suggesting
that you can or should do that when using %union; they are presented as
two different ways of defining the type.  So I find it a bit surprising
that the #if is there at all in parse.h.  Nonetheless it is there in
all versions from 1.875 to 2.3, and in the 2.3 manual it says

     Unless `YYSTYPE' is already defined as a macro, the output header
     declares `YYSTYPE'.

So apparently the Bison guys do intend to carry that behavior forward.

AFAICT, therefore, the proposed patch should only define YYSTYPE and
not anything else (there's no need to be afraid of YYLTYPE at present).

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Zdenek Kotala
Дата:
Сообщение: Re: Fix pg_dump dependency on postgres.h
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: a tsearch2 (8.2.4) dictionary that only filters out stopwords