Re: Two coverity non-bugs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Two coverity non-bugs
Дата
Msg-id 25867.1145457141@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Two coverity non-bugs  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Two coverity non-bugs  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-patches
Martijn van Oosterhout <kleptog@svana.org> writes:
> Attached is a patch that fixes two non-bugs. There's plenty of
> redundant NULL checks around the place but these were just so silly I
> figure they're worth fixing.

> The first checks 'file' the line after having dereferenced it. The
> second checks 'currSchema' where the code is designed to never allow it
> to be NULL.

The first patch looks reasonable but I object to the second.  Coverity
is not going to dictate coding conventions to us --- it is not *nearly*
bright enough for that.  In this case, the code is locally allowing for
the possibility that AH->currSchema was NULL, and I don't consider it
good style to remove that allowance.  (I take it BTW that this allegedly
bulletproof tool fails to consider the possibility that strdup fails
and returns NULL ...)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] bug in windows xp
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: [BUGS] bug in windows xp