Commit Graph

24 Commits

Author SHA1 Message Date
Thomas Munro 9db300ce6e Remove HP-UX port.
HP-UX hardware is no longer produced, build farm coverage recently
ended, and there are no known active maintainers targeting this OS.
Since there is a major rewrite of the build system in the pipeline for
PostgreSQL 16, and that requires development, testing and maintainance
for each OS and tool chain, it seems like a good time to drop support
for:

 * HP-UX, the operating system.
 * HP aCC, the HP-UX native compiler.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Discussion: https://postgr.es/m/1415825.1656893299%40sss.pgh.pa.us
2022-07-08 14:05:05 +12:00
Thomas Munro af9e6331ae Add missing include guard to win32ntdll.h.
Oversight in commit e2f0f8ed.  Also add this file to the exclusion lists
in headerscheck and cpluscpluscheck, because Unix systems don't have a
header it includes.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/2760528.1641929756%40sss.pgh.pa.us
2022-01-12 10:19:00 +13:00
Bruce Momjian 27b77ecf9f Update copyright for 2022
Backpatch-through: 10
2022-01-07 19:04:57 -05:00
John Naylor a315b19cce Add exception for unicode_east_asian_fw_table.h to cpluspluscheck
unicode_east_asian_fw_table.h should not be compiled standalone, similarly
to unicode_combining_table.h, but cpluspluscheck did not get the memo.

Oversight in bab982161.

Per report from Tom Lane
2021-09-23 15:23:48 -04:00
Bruce Momjian ca3b37487b Update copyright for 2021
Backpatch-through: 9.5
2021-01-02 13:06:25 -05:00
Tom Lane d0587f52b3 Fix up recent breakage of headerscheck and cpluspluscheck.
headerscheck and cpluspluscheck should skip the recently-added
cmdtaglist.h header, since (like kwlist.h and some other similarly-
designed headers) it's not meant to be included standalone.

evtcache.h was missing an #include to support its usage of Bitmapset.

typecmds.h was missing an #include to support its usage of ParseState.

The first two of these were evidently oversights in commit 2f9661311.
I didn't track down exactly which change broke typecmds.h, but it
must have been some rearrangement in one of its existing inclusions,
because it's referenced ParseState for quite a long time and there
were not complaints from these checking programs before.
2020-03-21 18:28:44 -04:00
Tom Lane 7b425a5283 Blacklist port/win32_msvc/utime.h in cpluspluscheck and headerscheck.
Since commit 481c8e923 it tends to produce "error: sys/utime.h: No such
file or directory" on non-Windows platforms.
2020-03-02 14:35:22 -05:00
Peter Eisentraut cc25464763 Add exclusion to headercheck
src/include/common/unicode_combining_table.h is currently not meant to
be included standalone.  Things could be refactored to allow it, but
that would be beyond the present purpose.  So adding an exclusion here
seems best.

Discussion: https://www.postgresql.org/message-id/10754.1579535012@sss.pgh.pa.us
2020-01-24 12:23:06 +01:00
Bruce Momjian 7559d8ebfa Update copyrights for 2020
Backpatch-through: update all files in master, backpatch legal files through 9.4
2020-01-01 12:21:45 -05:00
Noah Misch 30ee5d17c2 For all ppc compilers, implement compare_exchange and fetch_add with asm.
This is more like how we handle s_lock.h and arch-x86.h.

Reviewed by Tom Lane.

Discussion: https://postgr.es/m/20191005173400.GA3979129@rfd.leadboat.com
2019-10-18 20:20:52 -07:00
Tom Lane 55ea109188 Add "headerscheck" script to test header-file compilability under C.
We already had "cpluspluscheck", which served the dual purposes of
verifying that headers compile standalone and that they compile as C++.
However, C++ compilers don't have the exact same set of error conditions
as C compilers, so this doesn't really prove that a header will compile
standalone as C.

Hence, add a second script that's largely similar but runs the C
compiler not C++.

Also add a bit more documentation than the none-at-all we had before.

Discussion: https://postgr.es/m/14803.1566175851@sss.pgh.pa.us
2019-08-19 14:22:56 -04:00
Tom Lane f4755a2c01 Make cpluspluscheck more portable.
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-02 13:45:01 -04:00
Tom Lane 10a53cae99 Un-break ecpg tests for Windows.
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-06-02 11:07:54 -04:00
Tom Lane 6f54b80edd Improve coverage of cpluspluscheck.
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-31 16:32:07 -04:00
Andres Freund b1cd7ce23f Integrate cpluspluscheck into build system.
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
2019-05-31 12:36:17 -07:00
Peter Eisentraut 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
Peter Eisentraut 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
Peter Eisentraut cf4d67e819 Exclude access/rmgrlist.h from cpluspluscheck
It is not meant to be included standalone.
2013-02-08 07:01:21 -05:00
Andrew Dunstan 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
Bruce Momjian 034dda61dd Mark cpluspluscheck as excutable in git. 2011-08-22 22:14:58 -04:00
Tom Lane 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
Tom Lane 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
Tom Lane 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
Peter Eisentraut 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