Re: boolean in C

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: boolean in C
Дата
Msg-id 6061.1247753871@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: boolean in C  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Ответы Re: boolean in C  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Список pgsql-hackers
Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:
> On 16 Jul 2009, at 14:53, Peter Eisentraut wrote:
>>>> the standard does not promise that type _Bool has size = 1 byte.
>>>> We have to have that because of on-disk compatibility requirements.

>>> I think the latter is easily fixable, or forceable to be one byte.

>> How do you plan to do that?

> by casting it to 1 byte type such as char ?

That's hardly going to improve readability for anyone.  Also, it will
flat out not work for the catalog struct declarations.  When we say
"bool relhasindex;" the compiler had better think that that's a
one-byte field.

> And it is pretty annoying, when your product also has its own BOOLean  
> defined...

IOW you're not using stdbool either?
        regards, tom lane


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: revised hstore patch
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Mostly Harmless: c++bookends - patch 2 of 4