summaryrefslogtreecommitdiff
path: root/src/tools/pginclude/cpluspluscheck
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
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-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.
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.
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.