Re: [HACKERS] Re: include-file cleanup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: include-file cleanup
Date
Msg-id 19759.932224907@sss.pgh.pa.us
Whole thread Raw
In response to Re: include-file cleanup  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: include-file cleanup
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.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.

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Fix up for BTP_CHAIN problems
Next
From: Tom Lane
Date:
Subject: Re: AW: [HACKERS] shared lib names