Re: ECPG patch causes warning

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: ECPG patch causes warning
Date: 2010-01-10 16:47:59
Message-ID: 4851.1263142079@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
> Tom Lane rta:
>> I think that the compiler has caught an actual mistake here.

> Yes, it's a mistake, but not an actual bug.
> The intent was to be able to catch unhandled
> cases in the application, just as in ecpg_dynamic_type().
> The fix for sqlda_dynamic_type() is to use the same cast:

> return -(int) type;

> Should I send a patch for this?

You should send a patch to *get rid of it*. Putting in a cast only
hides the fact that this logic will break on OIDs above 2G.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-10 16:53:30 Re: [PATCH] Windows x64 [repost]
Previous Message Magnus Hagander 2010-01-10 16:43:27 Re: [PATCH] Windows x64 [repost]