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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: multiple exception definition in pg_type.h -> error compiling postgres support in Qt with gcc v3.2 (SuSE 8.1)
Дата
Msg-id 17147.1034703556@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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)
Ответы Re: multiple exception definition in pg_type.h -> error  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: spurious "UNIQUE constraint matching given keys for referenced table" error
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: multiple exception definition in pg_type.h -> error