Re: use of int4/int32 in C code - Mailing list pgsql-hackers

From Tom Lane
Subject Re: use of int4/int32 in C code
Date
Msg-id 11353.1340113658@sss.pgh.pa.us
Whole thread Raw
In response to use of int4/int32 in C code  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: use of int4/int32 in C code  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> What is the latest theory on using int4 vs. int32 in C code?
> (equivalently int2, int16)

I thought the general idea was to use int32 most places, but int4 in
catalog declarations.  I don't think it's tremendously important if
somebody uses the other though.

> 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?

Can't get very excited about this either.  The most likely outcome of
a campaign to substitute the standard types is that back-patching would
become a truly painful activity.  IMO, anything that is going to result
in tens of thousands of diffs had better have a more-than-cosmetic
reason.  (That wouldn't apply if we only used int32_t in new code ...
but then, instead of two approved ways to do it, there would be three.
Which doesn't seem like it improves matters.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Testing 9.2 in ~production environment
Next
From: Merlin Moncure
Date:
Subject: Re: pgsql_fdw in contrib