multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)

From: ftm(dot)van(dot)vugt(at)foxi(dot)nl
To: undisclosed-recipients: ;
Subject: multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)
Date: 2002-10-15 13:54:04
Message-ID: 20021015135404.0088B475BC3@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Your name : Frank van Vugt
Your email address : ftm(dot)van(dot)vugt(at)foxi(dot)nl

(with thanks to Dimitri(at)TrollTech for his insight & examples)

System Configuration
---------------------
Architecture :
Intel Pentium III

Operating System :
Linux 2.4.19 with glibc 2.2.5 (SuSE v8.1)

PostgreSQL version :
PostgreSQL-7.2.3

Compiler used :
gcc v3.2

Please enter a FULL description of your problem:
------------------------------------------------

Postgresql itself compiles like a breeze, no problem there.
Config line: "./configure --with-openssl --with-perl --with-CXX"

Upon compiling TrollTech's Qt-library with postgresql support, the process
fails on numerous lines in pg_type.h with the following message:

> In file included from sql/drivers/psql/qsql_psql.cpp:49:
> /usr/src/postgresql/src/include/catalog/pg_type.h:196: declaration of
> `int*
> __errno_location()' throws different exceptions
> /usr/src/postgresql/src/include/catalog/pg_type.h:195: than previous
> declaration `int* __errno_location() throw ()'
> [...]

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

The problem is caused by lines such as:
DATA(insert OID = 16 ( bool PGUID 1 1 t b ... _null_ ));
DESCR("boolean, 'true'/'false'");

Since DATA and DESCR are defined in postgres.h:
/* these need to expand into some harmless, repeatable declaration */
#define DATA(x) extern int errno
#define DESCR(x) extern int errno

These lines are eventually expanded into:
extern int errno;
extern int errno;

Obviously, compiling the following source produces the same problem:

#include <errno.h>
extern int errno;
extern int errno;

Postgresql itself seems to never include <errno.h> along with
<catalog/pg_type.h>, otherwise it would suffer from the same problem

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

We might want to expand ( 'DATA', 'DESCR' ) into something else, one of them
anyway ;-)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-10-15 14:13:23 Re: spurious "UNIQUE constraint matching given keys for referenced table" error
Previous Message pgsql-bugs 2002-10-15 11:23:24 Bug #797: Inaccurate in PostgreSQL 7.3b2 Developer's Guide