Re: bool: symbol name collision

Поиск
Список
Период
Сортировка
От bryanh@giraffe-data.com (Bryan Henderson)
Тема Re: bool: symbol name collision
Дата
Msg-id 55346.bryanh@giraffe-data.com
обсуждение исходный текст
Ответ на Re: bool: symbol name collision  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-bugs
>>> It's quite annoying and
>>> sad that they added "bool" to c99 since otherwise it would just be a
>>> drop-in replacement with extra functionality and very low risk of
>>> conflicts. Instead they virtually guaranteed conflicts with any large
>>> software over a single define.
>
>For that reason they put it into a separate header file stdbool.h that
>no one is required to include.

Yes, and they didn't really create any conflicts that didn't already exist.
No one thinking broadly enough would define "bool" because of the high chance
that somebody else did too, because it's such an obvious name.  The same is
true of names such as "int32".

For this reason, before C99, there were few software distributions that
defined "bool", with the chance of a distribution doing so inversely
proportional to how popular the distribution was.

Likewise, programmers who defined "bool" in their own private code were (and I
guess still are) largely the inexperienced ones -- who hadn't yet been bitten
by an interface header file that arrogantly claimed the name "bool."

--
Bryan Henderson                                   San Jose, California

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

Предыдущее
От: bryanh@giraffe-data.com (Bryan Henderson)
Дата:
Сообщение: Re: bool: symbol name collision
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "SET search_path" clause ignored during function creation