Re: compile error of PostgreSQL 7.2 on FreeBSD-current

Lists: pgsql-hackerspgsql-patches
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: hiroyuki hanai <hanai(at)imgsrc(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: compile error of PostgreSQL 7.2 on FreeBSD-current
Date: 2002-02-08 18:40:27
Message-ID: 24933.1013193627@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> We can certainly move our header inclusion order around, but that is
>> simply an application-level workaround for a broken system header.

> I didn't think so. I always thought there were requirements in include
> ordering.

There are certain broken OSes that think it's okay to let applications
deal with that, but they are certainly broken. What is an application
supposed to do if two different implementations have conflicting
requirements for header include order? Why should it be an
application's responsibility to worry about it in the first place?

I don't even know of any place where it could be documented that
"<foo.h> requires <bar.h> to be included first" in the standard man
page layout, because there isn't a man page per header file. And I'll
definitely bet lunch that that FreeBSD developer didn't fix the man
pages to say any such thing when he made that typedef change ;-)

If all versions of Unix had identical system headers then this sort
of thing wouldn't be a big deal, but since they don't, "each header
can be included independently" is the only reasonable approach.

We have a number of workarounds of this kind in Postgres already,
and I don't doubt that this one will not be the last one. But that
does not persuade me that system headers with this sort of problem
are acceptable. In this case we have an opportunity to complain,
and we should.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: hiroyuki hanai <hanai(at)imgsrc(dot)co(dot)jp>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] compile error of PostgreSQL 7.2 on FreeBSD-current
Date: 2002-02-08 19:01:38
Message-ID: 200202081901.g18J1cZ23436@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

[ Moved to patches.]

I just did:

find /usr/include -name '*.h' | while read FILE
do
echo "#include <$FILE>" >x.c
echo "main(){}" >>x.c
cc -c x.c
done > out 2>&1

and look what I got, file attached. Who's OS can pass this test? I
realize some are g++ headers.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
/bjm/out.gz application/x-gzip 22.9 KB