summaryrefslogtreecommitdiff
path: root/src/tools/pginclude
AgeCommit message (Collapse)Author
2019-06-02Make cpluspluscheck more portable.Tom Lane
Teach it to scrape -I and -D switches from CPPFLAGS in Makefile.global. This is useful for testing on, eg, FreeBSD, where you won't get far without "-I/usr/local/include". Also, expand the set of blacklisted-for-unportability atomics headers, based on noting that arch-x86.h fails to compile on an ARM box. The other ones I'd omitted seem to compile all right on architectures they don't belong to, but that's surely too shaky to rely on. Let's do like we did for the src/include/port/ headers, and ignore all except the variant that's pulled in by the arch-independent header.
2019-06-02Un-break ecpg tests for Windows.Tom Lane
Declaring a function "inline" still doesn't work with Windows compilers (C99? what's that?), unless the macro provided by pg_config.h is in-scope, which it is not in our ECPG test programs. So the workaround I tried to use in commit 7640f9312 doesn't work for Windows. Revert the change in printf_hack.h, and instead just blacklist that file in cpluspluscheck --- since it's a not-installed test file, we don't really need to verify its C++ cleanliness anyway.
2019-05-31Improve coverage of cpluspluscheck.Tom Lane
Formerly, cpluspluscheck was only meant to examine headers that we thought of as exported --- but its notion of what we export was well behind the times. Let's just make it check *all* .h files, except for a well-defined blacklist, instead. While at it, improve its ability to use a C++ compiler other than g++, by scraping the CXX setting from Makefile.global and making it possible to override the warning options used (per suggestion from Andres Freund). Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru
2019-05-31Integrate cpluspluscheck into build system.Andres Freund
Previously cpluspluscheck wouldn't work in vpath builds, this commit fixes that. To make it easier to invoke, there's a top-level cpluspluscheck target. Discussion: https://postgr.es/20190530220244.kiputcbl4gkl2oo6@alap3.anarazel.de
2018-05-27Don't fall off the end of perl functionsAndrew Dunstan
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-04-27perltidy: Add option --nooutdent-long-quotesPeter Eisentraut
2018-04-25Reindent Perl files with perltidy version 20170521.Tom Lane
Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
2017-03-27Clean up Perl code according to perlcriticPeter Eisentraut
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-01-05Use 'use strict' in all Perl programsPeter Eisentraut
2016-04-11cpluspluscheck: Update include pathPeter Eisentraut
Some things in src/include/fe_utils require libpq headers, so add libpq's include path to the command line used here.
2013-05-29pgindent run for release 9.3Bruce Momjian
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
2013-03-01Exclude utils/probes.h and pg_trace.h from cpluspluscheckPeter Eisentraut
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-02-08Exclude access/rmgrlist.h from cpluspluscheckPeter Eisentraut
It is not meant to be included standalone.
2012-12-18Don't include postgres.h in postgres_fe.h for cpluspluscheck.Andrew Dunstan
Error exposed by recent Assert changes. Complaint from Peter Eisentraut.
2012-08-16Add URL for include file visualization tool.Bruce Momjian
2012-08-16Add possible alternate tool for pgrminclude, from Peter GeogheganBruce Momjian
2012-05-15Remove whitespace from end of linesPeter Eisentraut
pgindent and perltidy should clean up the rest.
2012-04-23Lots of doc corrections.Robert Haas
Josh Kupershmidt
2011-12-01Make pgcompinclude/pgrminclude less tied to Bruce's personal machine.Robert Haas
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-09-25In pgrminclude, document requirement to use pgcompinclude, and sortBruce Momjian
files so include removal is more predictable.
2011-09-24Document pgrminclude limitations.Bruce Momjian
2011-09-24Expand pgrminclude to exclude use of macros CppAsString and CppConcat.Bruce Momjian
2011-09-07Have pgrminclude skip files that use CppAsString2 because CppAsString2Bruce Momjian
will expaned undefined identifiers.
2011-09-01Improve method of avoiding fcinfo compile errors.Bruce Momjian
Fix pgrminclude C comment marker.
2011-08-28Modify pgrminclude -v to report include files that can't be compiled onBruce Momjian
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-27Allow more include files to be compiled in their own by adding missingBruce Momjian
include dependencies. Modify pgcompinclude to skip a common fcinfo error.
2011-08-27Add support for #elif to pgrminclude.Bruce Momjian
2011-08-26Add another pgdefine path check, and a cvs-git change.Bruce Momjian
2011-08-26Change references of CVS to .git.Bruce Momjian
2011-08-26Fix missing pgdefine detection in pgrminclude.Bruce Momjian
2011-08-26Modify pgrminclude to include all code, even in #if blocks. ProcessBruce Momjian
.h include files before .c files. Mark some includes as needed to be ignored by pgrminclude.
2011-08-26Cleanup of script.Bruce Momjian
2011-08-26do include files firstBruce Momjian
2011-08-26Fix #if blocks.Bruce Momjian
2011-08-26Fix pgrminclude regex pattern.Bruce Momjian
2011-08-26In pgrminclude, add code to skip includes with a marker comment.Bruce Momjian
2011-08-26In pgrminclude, make skipped include names constent and skip files withBruce Momjian
#if/#ifdefs.
2011-08-22Mark cpluspluscheck as excutable in git.Bruce Momjian
2010-12-27Remove -fno-operator-names switch from cpluspluscheck.Tom Lane
No longer needed now that bitand() and bitor() have been renamed.
2010-12-27Rearrange cpluspluscheck to check just one .h file at a time.Tom Lane
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-27Tweak cpluspluscheck to avoid directly #include'ing gram.h.Tom Lane
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-11-23Remove useless whitespace at end of linesPeter Eisentraut
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2009-07-16Make backend header files C++ safePeter Eisentraut
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.
2008-03-21More README src cleanups.Bruce Momjian
2006-07-19Add WIN32 compile suggestion to pginclude README.Bruce Momjian
2006-07-18Add pginclude testing ideas.Bruce Momjian
2006-07-17Mention dependency problems caused by pgrminclude on include files.Bruce Momjian
2006-07-15Create a tool to catch #include omissions that might not result in anyTom Lane
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-14Move CFLAGS for pginclude to the end of the command line.Bruce Momjian