Commit Graph

80 Commits

Author SHA1 Message Date
3a7cc727c7 Don't fall off the end of perl functions
This complies with the perlcritic policy
Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we
only currently check at severity level 5, the policy is raised to that
level until we move to level 4 or lower, so that any new infringements
will be caught.

A small cosmetic piece of tidying of the pgperlcritic script is
included.

Mike Blackwell

Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
2018-05-27 09:08:42 -04:00
d4f16d5071 perltidy: Add option --nooutdent-long-quotes 2018-04-27 11:37:43 -04:00
f04d4ac919 Reindent Perl files with perltidy version 20170521.
Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
2018-04-25 14:00:19 -04:00
facde2a98f Clean up Perl code according to perlcritic
Fix all perlcritic warnings of severity level 5, except in
src/backend/utils/Gen_dummy_probes.pl, which is automatically generated.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2017-03-27 08:18:22 -04:00
933b46644c Use 'use strict' in all Perl programs 2017-01-05 12:34:48 -05:00
ee5dbc8173 cpluspluscheck: Update include path
Some things in src/include/fe_utils require libpq headers, so add
libpq's include path to the command line used here.
2016-04-11 11:16:16 -04:00
9af4159fce pgindent run for release 9.3
This is the first run of the Perl-based pgindent script.  Also update
pgindent instructions.
2013-05-29 16:58:43 -04:00
1275b88f71 Exclude utils/probes.h and pg_trace.h from cpluspluscheck
They can include sys/sdt.h from SystemTap, which itself contains C++
code and so won't compile with a C++ compiler under extern "C" linkage.
2013-03-01 22:46:11 -05:00
cf4d67e819 Exclude access/rmgrlist.h from cpluspluscheck
It is not meant to be included standalone.
2013-02-08 07:01:21 -05:00
9ac749ceb5 Don't include postgres.h in postgres_fe.h for cpluspluscheck.
Error exposed by recent Assert changes.

Complaint from Peter Eisentraut.
2012-12-18 16:30:14 -05:00
86d0d16f8a Add URL for include file visualization tool. 2012-08-16 18:52:08 -04:00
c04b9c1f3d Add possible alternate tool for pgrminclude, from Peter Geoghegan 2012-08-16 11:56:00 -04:00
c8e086795a Remove whitespace from end of lines
pgindent and perltidy should clean up the rest.
2012-05-15 22:19:41 +03:00
5d4b60f2f2 Lots of doc corrections.
Josh Kupershmidt
2012-04-23 22:43:09 -04:00
3b86b4653c Make pgcompinclude/pgrminclude less tied to Bruce's personal machine.
Not everyone has /pg linked to the src subdirectory of their PostgreSQL
tree.  Also, cc isn't the way to invoke the compiler everywhere.
2011-12-01 14:44:32 -05:00
2594ad7436 In pgrminclude, document requirement to use pgcompinclude, and sort
files so include removal is more predictable.
2011-09-25 16:58:16 -04:00
84bbe57dc1 Document pgrminclude limitations. 2011-09-24 19:38:41 -04:00
337c0b0361 Expand pgrminclude to exclude use of macros CppAsString and CppConcat. 2011-09-24 09:24:14 -04:00
f19593754a Have pgrminclude skip files that use CppAsString2 because CppAsString2
will expaned undefined identifiers.
2011-09-07 12:59:17 -04:00
418d04ea73 Improve method of avoiding fcinfo compile errors.
Fix pgrminclude C comment marker.
2011-09-01 14:16:13 -04:00
94db6664e2 Modify pgrminclude -v to report include files that can't be compiled on
their own.

Avoid compile problems with defines being redefined after the removal of
the #if blocks.

Change script to use shell functions for simplicity.
2011-08-28 13:04:01 -04:00
4bd7333b14 Allow more include files to be compiled in their own by adding missing
include dependencies.

Modify pgcompinclude to skip a common fcinfo error.
2011-08-27 11:05:33 -04:00
d010391ac8 Add support for #elif to pgrminclude. 2011-08-27 09:25:19 -04:00
68c019a538 Add another pgdefine path check, and a cvs-git change. 2011-08-26 21:52:35 -04:00
e7088713cd Change references of CVS to .git. 2011-08-26 21:43:34 -04:00
8b0f0822fd Fix missing pgdefine detection in pgrminclude. 2011-08-26 18:21:32 -04:00
f8e41abd8a Modify pgrminclude to include all code, even in #if blocks. Process
.h include files before .c files.

Mark some includes as needed to be ignored by pgrminclude.
2011-08-26 18:15:15 -04:00
c6e9da17a1 Cleanup of script. 2011-08-26 18:15:15 -04:00
987214b4d5 do include files first 2011-08-26 18:15:14 -04:00
ac5f11e0ec Fix #if blocks. 2011-08-26 18:15:13 -04:00
910725b49d Fix pgrminclude regex pattern. 2011-08-26 10:33:18 -04:00
6f9afc351b In pgrminclude, add code to skip includes with a marker comment. 2011-08-26 10:08:39 -04:00
4399e81749 In pgrminclude, make skipped include names constent and skip files with
#if/#ifdefs.
2011-08-26 10:06:01 -04:00
034dda61dd Mark cpluspluscheck as excutable in git. 2011-08-22 22:14:58 -04:00
f79136439f Remove -fno-operator-names switch from cpluspluscheck.
No longer needed now that bitand() and bitor() have been renamed.
2010-12-27 15:03:24 -05:00
8c61f81b31 Rearrange cpluspluscheck to check just one .h file at a time.
This is slower than the original coding but avoids the problem of
including files in an unpredictable order.  Aside from being more
trustworthy, we can get rid of some exclusions that were formerly
made for what turn out to be ordering or re-inclusion problems.

I also modified it to include libpq's exported files in the check.
ecpg should be included as well, but I'm unclear on which ecpg .h
files are meant to be included by clients.
2010-12-27 12:51:44 -05:00
a977db6f1c Tweak cpluspluscheck to avoid directly #include'ing gram.h.
gram.h has ordering dependencies, which are satisfied when it's included
from gramparse.h, but might not be if it's pulled in directly.
2010-12-27 11:36:52 -05:00
fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
de160e2c00 Make backend header files C++ safe
This alters various incidental uses of C++ key words to use other similar
identifiers, so that a C++ compiler won't choke outright.  You still
(probably) need extern "C" { }; around the inclusion of backend headers.

based on a patch by Kurt Harriman <harriman@acm.org>

Also add a script cpluspluscheck to check for C++ compatibility in the
future.  As of right now, this passes without error for me.
2009-07-16 06:33:46 +00:00
fca9fff41b More README src cleanups. 2008-03-21 13:23:29 +00:00
9d9a65bfa7 Add WIN32 compile suggestion to pginclude README. 2006-07-19 15:06:06 +00:00
5ca68299be Add pginclude testing ideas. 2006-07-18 19:19:59 +00:00
2256d299bb Mention dependency problems caused by pgrminclude on include files. 2006-07-17 19:37:21 +00:00
2d11d26113 Create a tool to catch #include omissions that might not result in any
compiler warning, specifically #ifdef or #if defined tests on symbols
that are defined in a file not included.  The results are a bit noisy
and require care to interpret, but it's a lot better than no tool at all.
2006-07-15 03:27:42 +00:00
06bed485b0 Move CFLAGS for pginclude to the end of the command line. 2006-07-14 01:05:14 +00:00
10157d4e6f Skip stripping postgres_fe.h include file. 2006-07-13 18:25:09 +00:00
70e2e3d8b1 Improve pginclude tools to process include file usage by other include files. 2006-07-13 16:39:20 +00:00
99ac1e69ba Fix pgrminclude to work for stripping include files. 2006-07-12 16:28:27 +00:00
1be8f80288 Improve pginclude tests. 2006-07-11 20:51:25 +00:00