bool: symbol name collision

Поиск
Список
Период
Сортировка
От bryanh@giraffe-data.com (Bryan Henderson)
Тема bool: symbol name collision
Дата
Msg-id 118.bryanh@giraffe-data.com
обсуждение исходный текст
Ответы Re: bool: symbol name collision
Список pgsql-bugs
The interface header files for Postgres server extensions define "bool",
but that name is commonly used by other parts of user code, including
by standards (C99, C++).  That causes, at best, compile failures.

If Postgres has to define a boolean type in public header files, it should
use a name that won't collide, like postgres_bool.  Alternatively, it might
just #include <stdbool.h>, if it can depend upon a C99 compiler.

Incidentally, this collision is particularly heinous because structures that
are part of the server extension interface have "bool" members, and if the
server and user program are compiled with bools of different sizes,
disaster occurs.  Postgres's bool is one byte; often, bool is 4 bytes.

I saw this in Postgres 8.4.3.

--
Bryan Henderson                                   San Jose, California

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

Предыдущее
От: bryanh@giraffe-data.com (Bryan Henderson)
Дата:
Сообщение: reference to undefined macro _MSC_VER
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: BUG #5448: psql \set does not terminate if variable is referenced recursively