use of int4/int32 in C code

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема use of int4/int32 in C code
Дата
Msg-id 1340106378.26286.25.camel@vanquo.pezone.net
обсуждение исходный текст
Ответы Re: use of int4/int32 in C code  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
What is the latest theory on using int4 vs. int32 in C code?

(equivalently int2, int16)

I had the idea that using int4 was sort of deprecated, and most code
uses int32, but I've come across several uses of int4 lately that looked
odd to me.

I think the main reason that we define int4 in C is for the
src/include/catalog/ files, but that won't work anymore if we ever want
to have an int8 column there.

Ideas:

* Leave it be.

* Replace int4 by int32 everywhere except in the catalog files.  Hope it
stays that way.

* Mark int4 as deprecated, change catalog files to use int32, adjust the
bki generation scripts.  (I think removing int4 might not be wise, as
external modules might be using it.)

While we're at it, how do we feel about using C standard types like
int32_t instead of (or initially in addition to) our own definitions?
These are well established by now and would help modernize our code and
the code of extensions a bit.




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

Предыдущее
От: "Dickson S. Guedes"
Дата:
Сообщение: Re: pgsql_fdw in contrib
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Testing 9.2 in ~production environment