warnings for invalid function casts

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема warnings for invalid function casts
Дата
Msg-id 1e97628e-6447-b4fd-e230-d109cec2d584@2ndquadrant.com
обсуждение исходный текст
Ответы Re: warnings for invalid function casts  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: warnings for invalid function casts  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Some time ago, there were some discussions about gcc warnings produced 
by -Wcast-function-type [0].  To clarify, while that thread seemed to 
imply that the warnings appear by default in some compiler version, this 
is not the case AFAICT, and the warnings are entirely optional.

So I took a look at what it would take to fix all the warnings and came 
up with the attached patch.

There are three subplots:

1. Changing the return type of load_external_function() and 
lookup_external_function() from PGFunction to a generic pointer type, 
which is what the discussion in [0] started out about.

2. There is a bit of cheating in dynahash.c.  They keycopy field is 
declared as a function pointer that returns a pointer to the 
destination, to match the signature of memcpy(), but then we assign 
strlcpy() to it, which returns size_t.  Even though we never use the 
return value, I'm not sure whether this could break if size_t and 
pointers are of different sizes, which in turn is very unlikely.

3. Finally, there is some nonsense necessary in plpython, which is 
annoying but otherwise uninteresting.

Is there anything we want to pursue further here?


[0]: 
https://www.postgresql.org/message-id/flat/20180206200205.f5kvbyn6jawtzi6s%40alap3.anarazel.de

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Suraj Kharage
Дата:
Сообщение: Re: refactoring basebackup.c
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Possible missing segments in archiving on standby