Re: Unused header file inclusion

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, vignesh C <vignesh21@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-08-19T00:50:51Z
Lists: pgsql-hackers

Attachments

I wrote:
> (My headerscheck script is missing that header; I need to update it to
> match the latest version of cpluspluscheck.)

I did that, and ended up with the attached.  I'm rather tempted to stick
this into src/tools/ alongside cpluspluscheck, because it seems to find
rather different trouble spots than cpluspluscheck does.  Thoughts?

As of HEAD (927f34ce8), I get clean passes from both this and
cpluspluscheck, except for the FmgrInfo references in selfuncs.h.
I tried it on RHEL/Fedora, FreeBSD 12, and current macOS.

			regards, tom lane

Commits

  1. Add fmgr.h include to selfuncs.h.

  2. Add "headerscheck" script to test header-file compilability under C.

  3. Fix failure-to-compile-standalone in scripts_parallel.h.

  4. Remove fmgr.h includes from headers that don't really need it.

  5. Don't include utils/array.h from acl.h.

  6. Remove redundant prototypes for SQL callable functions.

  7. Remove unnecessary #include <limits.h>

  8. Teach tuplesort.c about "top N" sorting, in which only the first N tuples