Re: Setting -Werror in CFLAGS

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Setting -Werror in CFLAGS
Дата
Msg-id CAEYLb_VvuMgXDR6sivMSBYsvi5erkycphZcVTsfsatYhV7xxQQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Setting -Werror in CFLAGS  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 18 January 2012 19:40, Peter Eisentraut <peter_e@gmx.net> wrote:
> On ons, 2012-01-04 at 13:44 -0500, Robert Haas wrote:
>> I'm not thrilled about that either.  Especially since they seem to be
>> adding more and more warnings that are harder and harder to work
>> around for issues that are less and less important.  Unimportant
>> warnings that are easily avoidable are not so bad, but...
>>
> I think the reason they add all these new warnings is that a lot of
> software is of poor quality.  A lot of software probably doesn't check
> any return values, so they need to see those warnings.  If the last 3
> out of 100 are hard to fix, that might be a small price to pay.

I recently ran a static analysis tool, Clang Static Analyzer, on
Postgres. It was an amusing distraction for half an hour, but it
wasn't particularly useful. It was immediately obvious 1) Why the tool
flagged certain code as possibly questionable and 2) Why it wasn't
actually questionable at all. It would probably be really useful with
a poor quality codebase though.

As I've already said, the fact that a Clang warning successfully
flagged a bug in Postgres a while back does go to show that there is
some benefit to be had from all of these sorts of diagnostics. I have
a rather low opinion of GCC's diagnostics though.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: age(xid) on hot standby
Следующее
От: Tom Lane
Дата:
Сообщение: Re: age(xid) on hot standby