Re: [PATCH] Clear up perlcritic 'missing return' warning

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Clear up perlcritic 'missing return' warning
Дата
Msg-id 20180522083211.GB12027@paquier.xyz
обсуждение исходный текст
Ответ на [PATCH] Clear up perlcritic 'missing return' warning  (Mike Blackwell <maiku41@gmail.com>)
Ответы Re: [PATCH] Clear up perlcritic 'missing return' warning  (Mike Blackwell <maiku41@gmail.com>)
Список pgsql-hackers
On Mon, May 21, 2018 at 08:07:03PM -0500, Mike Blackwell wrote:
> This particular patch addresses the warning caused by falling off the end
> of a subroutine rather than explicitly returning.

Do we really want to make that a requirement?  Making sure that there is
a return clause if a subroutine returns a result makes sense to me, but
making it mandatory if the subroutine does not return anything and
callers don't expect it do is not really a gain in my opinion.  And this
maps with any C code.

Just today, I coded a perl subroutine which does not return any
results...  This is most likely going to be forgotten.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: SCRAM with channel binding downgrade attack
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Time to put context diffs in the grave