Re: Leaking definitions to user programs

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christof Petig <christof(dot)petig(at)wtal(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Jacek Jakubowski <ma0027(at)uni-wuppertal(dot)de>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: Leaking definitions to user programs
Date: 2001-01-20 04:50:55
Message-ID: 200101200450.XAA04227@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


You may find 7.1beta has fixed this. I know some include files were
rearranged in 7.1.

> Hi Bruce, Hi Michael,
>
> here is the really short patch for shutting out all postgres definitions
> from ecpg
> programs. (e.g. Datum, Pointer, DEBUG, ERROR).
> Someone really should take a look into libpq and do the same.
> But I had to copy a small part of c.h (bool,true,false,TRUE,FALSE) into
> ecpg/include/libecpg.h. And ... there is a possible bug in c.h. You
> can't check a
> typedef via #ifndef.
>
> typedef char bool;
> ...
> #ifndef bool
> typedef char bool;
> #endif
>
> will fail. But I don't know any decent solution to that problem!
> Perhaps c.h should be broken into seperate parts.
>
> Christof
>
> PS: to Jacek: you need this patch to compile libcommon++.a!
>
> Bruce Momjian wrote:
>
> > Thanks.
> >
> > > > Yes, leaking into user programs is a bad practice. Is there a
> > > > solution/patch for that?
> > >
> > > A solution would be a simple patch which is not available yet. But I plan on
> > > doing one (some other things still have higher priority).
> > >
> > > Christof

[ application/x-gzip is not supported, skipping... ]

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-01-20 05:00:09 Re: Transaction ID wraparound: problem and proposed solution
Previous Message Bruce Momjian 2001-01-20 04:43:05 Re: Re: BIT/BIT VARYING status