Re: [HACKERS] Re: include-file cleanup
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] Re: include-file cleanup |
Дата | |
Msg-id | 199907171538.LAA10653@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] Re: include-file cleanup (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] Re: include-file cleanup
Re: [HACKERS] Re: include-file cleanup |
Список | 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. 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@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
В списке pgsql-hackers по дате отправления: