From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Residual cpluspluscheck issues
Date: Sun, 02 Jun 2019 12:53:14 -0400
Message-ID: <20518.1559494394@sss.pgh.pa.us> (raw)
cpluspluscheck's expanded coverage is now passing cleanly for me on
the macOS laptop I was testing it with at PGCon. But on returning
home, I find there's still some issues on some other boxes:
* On Linux (at least Fedora and RHEL), I get variants of this:
/usr/include/arpa/inet.h:84: error: declaration of 'char* inet_net_ntop(int, const void*, int, char*, size_t) throw ()' throws different exceptions
/home/postgres/pgsql/src/include/port.h:506: error: from previous declaration 'char* inet_net_ntop(int, const void*, int, char*, size_t)'
That's because /usr/include/arpa/inet.h declares it as
extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
char *__buf, size_t __len) __THROW;
and of course when a C++ compiler reads that, __THROW will expand as
something nonempty.
One possible fix for that is to teach configure to test whether
arpa/inet.h provides a declaration, and not compile our own declaration
when it does. This would require being sure that we include arpa/inet.h
anywhere we use that function, but there are few enough callers that
that's not much of a hardship.
Alternatively, we could rename our function to pg_inet_net_ntop to
dodge the conflict. This might be a good idea anyway to avoid
confusion, since our function doesn't necessarily recognize the same
address-family codes that libc would.
* On FreeBSD 12, I get
/home/tgl/pgsql/src/include/utils/hashutils.h:23:23: warning: 'register' storage
class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
extern Datum hash_any(register const unsigned char *k, register int keylen);
^~~~~~~~~
/home/tgl/pgsql/src/include/utils/hashutils.h:23:56: warning: 'register' storage
class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
extern Datum hash_any(register const unsigned char *k, register int keylen);
^~~~~~~~~
/home/tgl/pgsql/src/include/utils/hashutils.h:24:32: warning: 'register' storage
class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
extern Datum hash_any_extended(register const unsigned char *k,
^~~~~~~~~
/home/tgl/pgsql/src/include/utils/hashutils.h:25:11: warning: 'register' storage
class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
register int ...
^~~~~~~~~
which I'm inclined to think means we should drop those register keywords.
(The FreeBSD box shows another couple of complaints too, but I think
the fixes for those are uncontroversial.)
Comments?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: Residual cpluspluscheck issues
In-Reply-To: <20518.1559494394@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox