Re: Declared but no defined functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declared but no defined functions
Date: 2019-07-05 23:32:31
Message-ID: 2478.1562369551@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> writes:
> I think the following functions are mistakenly left in the header
> file. So attached patch removes them.

> dsa_startup()
> TransactionIdAbort()
> renameatt_type()

Agreed, these are referenced nowhere. I pushed the patch.

> I realized that TransactionIdAbort is declared in the transam.h but
> there is not its function body. As far as I found there are three
> similar functions in total by the following script.
> for func in `git ls-files | egrep "\w+\.h$" | xargs cat | egrep
> "extern \w+ \w+\(.*\);" | sed -e "s/.* \(.*\)(.*);/\1(/g"`
> do
> if [ `git grep "$func" -- "*.c" | wc -l` -lt 1 ];then
> echo $func
> fi
> done

FWIW, that won't catch declarations that lack "extern", nor functions
that return pointer-to-something. (Omitting "extern" is something
I consider bad style, but other people seem to be down with it.)
Might be worth another pass to look harder?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-07-06 02:05:27 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Bruce Momjian 2019-07-05 23:07:36 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)