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

From Tom Lane
Subject Re: multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)
Date
Msg-id 17147.1034703556@sss.pgh.pa.us
Whole thread Raw
In response to multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)  (ftm.van.vugt@foxi.nl)
Responses Re: multiple exception definition in pg_type.h -> error  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
ftm.van.vugt@foxi.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: spurious "UNIQUE constraint matching given keys for referenced table" error
Next
From: Peter Eisentraut
Date:
Subject: Re: multiple exception definition in pg_type.h -> error