
> > Could you please try to just remove the cpp flag? Also I wonder why you are
> > using "long long int" instead of just "long int" in your C program. Well
> > that is the people who complained to you.
> 
> Yes, dropping the CPP flags solves the problem for us. I assume all
> platforms have long long now?
> 
> We used long long as this seems to be pretty consistently 64 bits on
> different platforms, and our code runs on Tru64, PC linux and openBSD.

I think the people did the perfectly correct thing to use long long int,
since that makes their code more portable.
Can someone try to help me understand this please ?
My understanding so far is:
	1. long int is the same as long (32 or more bits)
	2. long long int is at least 64 bits (I have so far not seen more that 64 bits)
		(my original understanding was that it is 64bits, but Tom corrected me)

So my conclusion would be, that ecpg should understand "long long int" since
that is preferable over a "long int" that is 64bits by chance.

I do agree with the statement, that HAVE_LONG_LONG_INT_64 shoud be
defined on all platforms where the compiler understands it to be 64bits.
It would imho be the responsibility of backend code, to only do one of
the two if both are defined.
Otherwise the defines should have a different name like USE_....

Andreas

Thu, 5 Apr 2001 10:01:53 +0200 
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at>
AW: ecpg long int problem on alpha + fix
On Thu, Apr 05, 2001 at 10:01:53AM +0200, Zeugswetter Andreas SB wrote:
> I do agree with the statement, that HAVE_LONG_LONG_INT_64 shoud be
> defined on all platforms where the compiler understands it to be 64bits.
> It would imho be the responsibility of backend code, to only do one of
> the two if both are defined.

I just committed some changes so that ecpg does acceptt "long long"
variables all the time, but repleces them with type "long" if
HAVE_LONG_LONG_INT_64 is not defined. This appears to be a strategy similar
to the one used by the backend.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Thu, 5 Apr 2001 10:40:03 +0200
Michael Meskes <meskes@postgresql.org>
Re: ecpg long int problem on alpha + fix
Michael Meskes <meskes@postgresql.org> writes:
> I just committed some changes so that ecpg does acceptt "long long"
> variables all the time, but repleces them with type "long" if
> HAVE_LONG_LONG_INT_64 is not defined.

This looks like a workable strategy for now.  Ten years from now, when
"long" means 64 bits everywhere and people are starting to use "long long"
to mean 128 bits, we'll have to revisit it ;-)

			regards, tom lane

Thu, 05 Apr 2001 13:31:13 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: ecpg long int problem on alpha + fix 