Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 909401B2D9D5 for ; Mon, 26 Mar 2012 16:15:58 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SCFOW-0000qk-EH for pgsql-hackers@postgresql.org; Mon, 26 Mar 2012 19:15:57 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q2QJFgtI015769; Mon, 26 Mar 2012 15:15:42 -0400 (EDT) To: Peter Eisentraut cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Remove dead assignment In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Mon, 26 Mar 2012 18:26:54 -0000" Date: Mon, 26 Mar 2012 15:15:42 -0400 Message-ID: <15768.1332789342@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/1577 X-Sequence-Number: 205459 Peter Eisentraut 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