Re: freefuncs.c is never called from anywhere!?]

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: The Hermit Hacker <scrappy(at)hub(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: freefuncs.c is never called from anywhere!?]
Date: 2000-06-09 16:52:33
Message-ID: 200006091652.MAA10392@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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:

GetAttributeByName
GetAttributeByNum

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(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 Bruce Momjian 2000-06-09 17:10:46 Re: freefuncs.c is never called from anywhere!?]
Previous Message Bruce Momjian 2000-06-09 16:04:10 Re: xlog.c.patch for cygwin port.