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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ftm(dot)van(dot)vugt(at)foxi(dot)nl
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)
Date: 2002-10-15 17:39:16
Message-ID: 17147.1034703556@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
ftm(dot)van(dot)vugt(at)foxi(dot)nl writes:
> Postgresql itself seems to never include <errno.h> along with 
> <catalog/pg_type.h>, otherwise it would suffer from the same problem

That's hard to believe; I think it's Qt that's doing something strange
here.  Still, the ANSI C standard does discourage what we are doing:

       ...  It is unspecified whether  errno
       is  a macro or an identifier declared with external linkage.
       If a macro definition is suppressed in order  to  access  an
       actual  object,  or a program defines an identifier with the
       name errno, the behavior is undefined.

Seems like almost anything else would be safer than "errno" :-(

Anyone object to doing

	extern int no_such_variable;

instead?

(Note that just having the macros expand to empty won't do,
because then the compiler would see a string of semicolons,
and some compilers warn about that.)

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2002-10-15 18:59:44
Subject: Re: multiple exception definition in pg_type.h -> error
Previous:From: Tom LaneDate: 2002-10-15 14:13:23
Subject: Re: spurious "UNIQUE constraint matching given keys for referenced table" error

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