Обсуждение: BUG #5464: ecpg on 64bit system converts "long long" to "long"

Поиск
Список
Период
Сортировка

BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
"Michael Enke"
Дата:
The following bug has been logged online:

Bug reference:      5464
Logged by:          Michael Enke
Email address:      michael.enke@wincor-nixdorf.com
PostgreSQL version: 8.4.4
Operating system:   Linux
Description:        ecpg on 64bit system converts "long long" to "long"
Details:

This applies for at least ecpg 4.5.0 and 4.4.0.
On 32 bit system the type is not changed.
Example:
----------------------------------------
EXEC SQL INCLUDE sqlca;

EXEC SQL BEGIN DECLARE SECTION;
  long long test;
EXEC SQL END DECLARE SECTION;

int main(int argc, char **argv) {

  return 0;
}
----------------------------------------
If you run it through ecpg, in the resulting c file
the variable test has type long on 64 bit system.
On 32 bit system it is long long.

Re: BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
Michael Meskes
Дата:
On Wed, May 19, 2010 at 08:53:12AM +0000, Michael Enke wrote:
> If you run it through ecpg, in the resulting c file
> the variable test has type long on 64 bit system.
> On 32 bit system it is long long.

Apparently when this code was written "long long" was 64bit, but it doesn't
seem to be that way on 64bit systems nowadays. I will check to see if there is
an easy fix. If it is fairly interruptive the fix won't make it into 9.0
though.

Michael

--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL

Re: BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
John R Pierce
Дата:
Michael Meskes wrote:
> On Wed, May 19, 2010 at 08:53:12AM +0000, Michael Enke wrote:
>
>> If you run it through ecpg, in the resulting c file
>> the variable test has type long on 64 bit system.
>> On 32 bit system it is long long.
>>
>
> Apparently when this code was written "long long" was 64bit, but it doesn't
> seem to be that way on 64bit systems nowadays. I will check to see if there is
> an easy fix. If it is fairly interruptive the fix won't make it into 9.0
> though.
>

I'm pretty sure it varies with the 64 bit system.  I believe on IBM
Power, LONG LONG *is* 64 bit.

Re: BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
Michael Meskes
Дата:
On Wed, May 19, 2010 at 10:34:42AM -0700, John R Pierce wrote:
> I'm pretty sure it varies with the 64 bit system.  I believe on IBM
> Power, LONG LONG *is* 64 bit.

I'm currently without real access to a 64bit system until I come back home. If
it is 64bit on *all* 64bit systems the problem is slightly different.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL

Re: BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
Michael Enke
Дата:
Michael Meskes schrieb:
> On Wed, May 19, 2010 at 10:34:42AM -0700, John R Pierce wrote:
>> I'm pretty sure it varies with the 64 bit system.  I believe on IBM
>> Power, LONG LONG *is* 64 bit.
>=20
> I'm currently without real access to a 64bit system until I come back hom=
e. If
> it is 64bit on *all* 64bit systems the problem is slightly different.=20
>=20
> Michael=20

The size of long *and* long long is 64 bit on x86_64 system.
But the compiler throws warnings for %lld with long int type.
It should not be required to change the code to not run into such warnings.
Yes, I know the PRI... macros from inttypes.h ...

Michael

WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Gesch=C3=A4ftsf=C3=BChrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach,=
 Dr. J=C3=BCrgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE444=
77193

Diese E-Mail enth=C3=A4lt vertrauliche Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt=C3=BCmlich=
 erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist ni=
cht gestattet.

This e-mail may contain confidential information.
If you are not the intended recipient (or have received this e-mail in erro=
r)
please notify the sender immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in thi=
s e-mail is strictly forbidden.

Re: BUG #5464: ecpg on 64bit system converts "long long" to "long"

От
Michael Meskes
Дата:
> > I'm currently without real access to a 64bit system until I come back home. If
> > it is 64bit on *all* 64bit systems the problem is slightly different.

Just committed a patch to HEAD that hopefully fixes the problem.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL