Skip site navigation (1) Skip section navigation (2)

Re: Leaking definitions to user programs

From: Christof Petig <christof(dot)petig(at)wtal(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
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: 2000-11-03 14:53:33
Message-ID: 3A02D16D.77061340@wtal.de (view raw or flat)
Thread:
Lists: pgsql-hackers
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

Attachment: ecpg.diff.gz
Description: application/x-gzip (405 bytes)

Responses

pgsql-hackers by date

Next:From: Ned LillyDate: 2000-11-03 15:07:39
Subject: live chat on associative model databases (starts 11:00 ET today)
Previous:From: Zeugswetter Andreas SBDate: 2000-11-03 14:05:27
Subject: AW: relation ### modified while in use

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group