Re: C++ interface build on FreeBSD 4.2 broken? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: C++ interface build on FreeBSD 4.2 broken?
Date
Msg-id 1648.980008619@sss.pgh.pa.us
Whole thread Raw
In response to Re: C++ interface build on FreeBSD 4.2 broken?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: C++ interface build on FreeBSD 4.2 broken?
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
>> ../../../src/include/c.h:997: conflicting types for `int sys_nerr'
>> /usr/include/stdio.h:224: previous declaration as `const int sys_nerr'

> C++ apparently doesn't allow this, but C does.  So you have to put #ifndef
> __cplusplus at the appropriate place in c.h.

Er, what will you ifdef exactly, and what are the odds that it will fail
on some other platform?  (On my machine, for example, sys_nerr is
definitely NOT declared const by the system header files, and so adding
a const decoration to our declaration would fail.)

I think our choices are to do a configure test or to stop using sys_nerr
altogether.  At the moment I'm kind of leaning towards the latter.
I suspect machines whose strerror() is without a rangecheck are history,
and even if they're not, it's unproven that we ever pass a bogus errno
to strerror anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: status of 64bit ints? was: Re: Transaction ID wraparound: problem and proposed solution
Next
From: Peter Eisentraut
Date:
Subject: Re: C++ interface build on FreeBSD 4.2 broken?