Re: freefuncs.c is never called from anywhere!?]
От | Bruce Momjian |
---|---|
Тема | Re: freefuncs.c is never called from anywhere!?] |
Дата | |
Msg-id | 200006091652.MAA10392@candle.pha.pa.us обсуждение исходный текст |
Список | pgsql-hackers |
> Bruce Momjian <pgman@candle.pha.pa.us> writes: > > I am thinking of going through the code and removing NOT_USED functions > > I know to be useless. OK? > > Don't see why not, though I'd recommend treading lightly. That unused- > functions script tends to pull out stuff that has been exported in the > expectation that someone would want it someday, but for one reason or > another it's not being called right at the moment. We don't really want > to delete that sort of code. > > BTW, I've also been rather dubious about the automatic > demote-to-static-function script for the same reason --- when someone > comes along and needs function X, it's hard to tell whether X was > intended to be private or was intended to be public but got demoted by > the script. It's tough to maintain clear module APIs with tools like > that second-guessing the author's intentions. Well, I put a comment on one's that have to be exported, and others come up as referenced in the regression tests. The only one I know about is: GetAttributeByNameGetAttributeByNum and some debug functions. The above two are the only ones that I marked as static at one time that I later had to export. The other advantage of static is that if a static function is not called in the file, the compiler throws a warning and I can then mark it as NOT_USED. -- Bruce Momjian | http://www.op.net/~candle pgman@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 по дате отправления: