Re: Unused header file inclusion

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: vignesh C <vignesh21@gmail.com>, Andres Freund <andres@anarazel.de>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-08-07T21:00:08Z
Lists: pgsql-hackers
On 2019-Aug-05, Tom Lane wrote:

> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Then there's the <limits.h> removal, which is in tuplesort.c because of
> > INT_MAX as added by commit d26559dbf356 and still present ...
> 
> One has to be especially wary of removing system-header inclusions;
> the fact that they don't seem to be needed on your own machine doesn't
> prove they aren't needed elsewhere.

As far as I can see, this line was just carried over from tuplestore.c,
but that file uses INT_MAX and this one doesn't use any of those macros
as far as I can tell.

I pushed this change and hereby consider this to be over.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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