Re: [COMMITTERS] pgsql: Remove dead assignment

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [COMMITTERS] pgsql: Remove dead assignment
Дата
Msg-id 15768.1332789342@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Remove dead assignment
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Remove dead assignment
> found by Coverity
   init_sequence(seq_relid, &elm, &seq_rel);
-   seq = read_info(elm, seq_rel, &buf);
+   read_info(elm, seq_rel, &buf);


I have to object to this patch.  In the blind service of eliminating
warnings from some tool or other, you will introduce warnings from
other tools?  It's traditional for lint to complain about code that
sometimes ignores the return value of a function, for instance.
I also do not think it does anything for readability for this call
of read_info() to be unexpectedly unlike all the others.

I think we should institute a project policy that we will ignore "dead
assignment" coverity warnings.  I have not seen one of those changes
yet that seemed to me like a good idea.  Any optimizing compiler is
perfectly capable of figuring out that an assignment is dead and
eliminating it, so there is no code size advantage from doing this
manually; and even the gcc boys have not (yet?) decided they should
warn about dead assignments.
        regards, tom lane


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

Предыдущее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Replace empty locale name with implied value in CREATE DATABASE
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Command Triggers, v16