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-18T18:37:34Z
Lists: pgsql-hackers
Attachments
- headerscheck (text/x-shellscript)
Andres Freund <andres@anarazel.de> writes: > I've pushed the other ones. Checking whether header files compile standalone shows you were overly aggressive about removing fmgr.h includes: In file included from /tmp/headerscheck.Ss8bVx/test.c:3: ./src/include/utils/selfuncs.h:143: error: expected declaration specifiers or '...' before 'FmgrInfo' ./src/include/utils/selfuncs.h:146: error: expected declaration specifiers or '...' before 'FmgrInfo' ./src/include/utils/selfuncs.h:152: error: expected declaration specifiers or '...' before 'FmgrInfo' That's with a script I use that's like cpluspluscheck except it tests with plain gcc not g++. I attached it for the archives' sake. Oddly, cpluspluscheck does not complain about those cases, but it does complain about In file included from /tmp/cpluspluscheck.FgX2SW/test.cpp:4: ./src/bin/scripts/scripts_parallel.h:18: error: ISO C++ forbids declaration of 'PGconn' with no type ./src/bin/scripts/scripts_parallel.h:18: error: expected ';' before '*' token ./src/bin/scripts/scripts_parallel.h:29: error: 'PGconn' has not been declared (My headerscheck script is missing that header; I need to update it to match the latest version of cpluspluscheck.) regards, tom lane
Commits
-
Add fmgr.h include to selfuncs.h.
- 4c01a1110388 13.0 landed
-
Add "headerscheck" script to test header-file compilability under C.
- 55ea10918847 13.0 landed
-
Fix failure-to-compile-standalone in scripts_parallel.h.
- 5f110933e114 13.0 landed
-
Remove fmgr.h includes from headers that don't really need it.
- fb3b098fe884 13.0 landed
-
Don't include utils/array.h from acl.h.
- 6a04d345fd80 13.0 landed
-
Remove redundant prototypes for SQL callable functions.
- 0ae2dc4db2ae 13.0 landed
-
Remove unnecessary #include <limits.h>
- e1f4c481b995 13.0 landed
-
Teach tuplesort.c about "top N" sorting, in which only the first N tuples
- d26559dbf356 8.3.0 cited