Re: Suggested change in include/utils/elog.h

From: Christof Petig <christof(dot)petig(at)wtal(dot)de>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "David R(dot) Favor" <dfavor(at)austin(dot)ibm(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: Suggested change in include/utils/elog.h
Date: 2000-10-02 21:54:46
Message-ID: 39D90426.15076AF3@wtal.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:

> If you do decide to prefix DEBUG, please consider prefixing at least ERROR
> as well. It produces a lot of warnings when compiling on Win32 (ERROR is
> already defined as part of the standard windows headers). It's just
> warnings, though.
>
> //Magnus
>
> > Do other people have a comment on this. I am inclined to leave it
> > along. This is the first complaint I have heard, and
> > elog(PGDEBUG) just
> > looks funny. We don't prefix NOTICE or ERROR.
> >
> >
> > > In the file
> > >
> > > include/utils/elog.h
> > >
> > > there is a macro named
> > >
> > > DEBUG
> > >
> > > that conflicts with the perl5.6 macro DEBUG.
> > >
> > > PostgreSQL would probably "play" better with other products if
> > > the DEBUG macro had a prefix, maybe PGSQLDEBUG or similar.
> > >
> > > Until there is some fix in this area, plperl will not build with
> > > a version of perl that has debugging enabled.
> > >

It even got on my nerves (linux, ecpg) since I used to define a macro
#define DEBUG(x) cout << x
or
#define DEBUG(x)

DEBUG and ERROR are far too common to get defined for client programs.

But perhaps it is ecpg's fault for including "elog.h".
IMHO these defines should never leave the database kernel.

perhaps the common
#ifdef _DBKERNEL_
#endif
would do the trick.

Christof

PS: Having Datum unconditionally leaked to ecpg programs forced me to preced
a namespace to my own class.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2000-10-02 22:17:12 more crashes
Previous Message Keith Parks 2000-10-02 21:32:07 Re: What's happening with pgsql-committers?