Residual cpluspluscheck issues

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Residual cpluspluscheck issues
Дата
Msg-id 20518.1559494394@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Residual cpluspluscheck issues  (Jesse Zhang <sbjesse@gmail.com>)
Список pgsql-hackers
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 ()'
throwsdifferent 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Binguo Bao
Дата:
Сообщение: Optimize partial TOAST decompression
Следующее
От: Peter Geoghegan
Дата:
Сообщение: unused_oids script should advertise reserved OID range