Re: [HACKERS] Re: include-file cleanup

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: include-file cleanup
Date: 1999-07-17 15:38:43
Message-ID: 199907171538.LAA10653@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> >> Your script should have
> >> noticed that the name "random" mentioned in config.h was also
> >> mentioned in port/random.c, and therefore not removed the include
> >> of config.h from random.c. Why did it not make the connection?
>
> > Because the random prototype is in stdlib.h in BSD/OS, and that file was
> > already #included. Seems it must be in another file in your OS.
> > stdlib.h:168: long random __P((void));
>
> Ah, well there is the problem: you are (in effect) assuming that
> if stdlib.h defines random() on your platform, then it does so on
> everyone's platform. If that were true, we'd not need port/random.c...
>
> I think your script ought to be set up to ignore system headers
> completely, and only look at our own headers to determine which
> symbols are defined where.

Well, the script just does the compile with and without the #include.
Really no way to test if the existance of system tables causes any
difference, and if I remove the system files completely, the code will
not compile.

> In theory, only config.h and c.h should contain any substitutes for
> system-header symbols, so if you explicitly exclude those two from
> removal then there should be no portability issue. But I'd be
> happier if you changed the script so that its decisions are not
> affected by the contents of system headers.

I have added c.h to the list of files I skip in pgnoinclude. I can't
think of any way to prevent system headers from causing such problems,
though.

I specifically don't remove any system headers for this very reason,
that different OS's may need system files that I don't.

--
Bruce Momjian | http://www.op.net/~candle
maillist(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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-07-17 16:17:01 Re: [HACKERS] Re: include-file cleanup
Previous Message Tom Lane 1999-07-17 15:32:46 Re: AW: [HACKERS] shared lib names