Unix Technical Forum

Re: [COMMITTERS] pgsql: Have find_static skip main() functions.

This is a discussion on Re: [COMMITTERS] pgsql: Have find_static skip main() functions. within the pgsql Hackers forums, part of the PostgreSQL category; --> momjian@postgresql.org (Bruce Momjian) writes: > Have find_static skip main() functions. Uh-oh, don't tell me you are cranking up to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 04:28 AM
Tom Lane
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Have find_static skip main() functions.

momjian@postgresql.org (Bruce Momjian) writes:
> Have find_static skip main() functions.


Uh-oh, don't tell me you are cranking up to run *that* thing again.

This time around, please do not remove API functions just because you
can't find a reference to them in the core code. I would like to see
a posted, discussed patch first.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 04:28 AM
Bruce Momjian
 
Posts: n/a
Default Patch to mark items as static or not used

Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Have find_static skip main() functions.

>
> Uh-oh, don't tell me you are cranking up to run *that* thing again.
>
> This time around, please do not remove API functions just because you
> can't find a reference to them in the core code. I would like to see
> a posted, discussed patch first.


OK, here is my match to mark items as static or not used:

ftp://momjian.us/pub/postgresql/mypatches/static

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 04:28 AM
Tom Lane
 
Posts: n/a
Default Re: Patch to mark items as static or not used

Bruce Momjian <bruce@momjian.us> writes:
> Tom Lane wrote:
>> This time around, please do not remove API functions just because you
>> can't find a reference to them in the core code. I would like to see
>> a posted, discussed patch first.


> OK, here is my match to mark items as static or not used:
> ftp://momjian.us/pub/postgresql/mypatches/static


By and large, this just demonstrates the silliness of using an automated
tool for this purpose :-(. The hits in gist and gin might be valid ---
Teodor would need to comment on that --- but almost every one of the
others is a "no, don't do that". As an example, you've successfully
reverted this recent patch in toto:

2006-04-26 20:46 tgl

* src/: backend/utils/adt/selfuncs.c, include/utils/selfuncs.h: If
we're going to expose VariableStatData for contrib modules to use,
then we should export a reasonable set of the supporting routines
too.

The fundamental problem with find_static is that it hasn't got a clue
about likely future changes, nor about what we think external add-ons
might want ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 04:28 AM
Bruce Momjian
 
Posts: n/a
Default Re: Patch to mark items as static or not used

Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Tom Lane wrote:
> >> This time around, please do not remove API functions just because you
> >> can't find a reference to them in the core code. I would like to see
> >> a posted, discussed patch first.

>
> > OK, here is my match to mark items as static or not used:
> > ftp://momjian.us/pub/postgresql/mypatches/static

>
> By and large, this just demonstrates the silliness of using an automated
> tool for this purpose :-(. The hits in gist and gin might be valid ---
> Teodor would need to comment on that --- but almost every one of the
> others is a "no, don't do that". As an example, you've successfully
> reverted this recent patch in toto:
>
> 2006-04-26 20:46 tgl
>
> * src/: backend/utils/adt/selfuncs.c, include/utils/selfuncs.h: If
> we're going to expose VariableStatData for contrib modules to use,
> then we should export a reasonable set of the supporting routines
> too.
>
> The fundamental problem with find_static is that it hasn't got a clue
> about likely future changes, nor about what we think external add-ons
> might want ...


OK, I don't really have a clue either. Is any of it valid?

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-12-2008, 04:28 AM
Tom Lane
 
Posts: n/a
Default Re: Patch to mark items as static or not used

Bruce Momjian <bruce@momjian.us> writes:
> Tom Lane wrote:
>> The fundamental problem with find_static is that it hasn't got a clue
>> about likely future changes, nor about what we think external add-ons
>> might want ...


> OK, I don't really have a clue either. Is any of it valid?


I don't object to static-izing AlterOpClassOwner_oid or
RenameRewriteRule, and I defer to Teodor about the gist and gin
functions. The others range somewhere between "no" and "hell no".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-12-2008, 04:28 AM
Neil Conway
 
Posts: n/a
Default Re: Patch to mark items as static or not used

On Sat, 2006-07-15 at 00:05 -0400, Tom Lane wrote:
> The fundamental problem with find_static is that it hasn't got a clue
> about likely future changes, nor about what we think external add-ons
> might want


We could annotate the source to indicate that some functions are
deliberately intended to be externally visible, but not referenced
within the source tree, and then teach find_static to grok that
annotation.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-12-2008, 04:28 AM
Teodor Sigaev
 
Posts: n/a
Default Re: Patch to mark items as static or not used


> RenameRewriteRule, and I defer to Teodor about the gist and gin
> functions. The others range somewhere between "no" and "hell no".


I think that gistcentryinit() and extractEntriesS() should not be a
static.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-12-2008, 04:28 AM
Andrew Dunstan
 
Posts: n/a
Default Re: Patch to mark items as static or not used

Neil Conway wrote:
> On Sat, 2006-07-15 at 00:05 -0400, Tom Lane wrote:
>
>> The fundamental problem with find_static is that it hasn't got a clue
>> about likely future changes, nor about what we think external add-ons
>> might want
>>

>
> We could annotate the source to indicate that some functions are
> deliberately intended to be externally visible, but not referenced
> within the source tree, and then teach find_static to grok that
> annotation.
>
>


I thought of that, but what if one gets missed? Is the tool worth the
hassle?

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-12-2008, 04:28 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: Patch to mark items as static or not used

On Sat, Jul 15, 2006 at 09:34:57AM -0400, Andrew Dunstan wrote:
> Neil Conway wrote:
> >We could annotate the source to indicate that some functions are
> >deliberately intended to be externally visible, but not referenced
> >within the source tree, and then teach find_static to grok that
> >annotation.

>
> I thought of that, but what if one gets missed? Is the tool worth the
> hassle?


The tool is just a tool. The annotation is so that some human won't
come to the conclusion that it can be removed. Teaching the tool to
skip it is just a bonus.

Some places mark external functions with DLLEXPORT but I guess we could
invent a comment that would be machine readable.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEuQcvIB7bNG8LQkwRAmfGAJ0dlUjNnQn0hePSPM3UAF s7CZZPBQCeJjqj
hGiOwL55opjAHrxZPyYVdnU=
=pvPa
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com