Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 3088F1B2D9D5 for ; Mon, 26 Mar 2012 16:29:36 -0300 (ADT) Received: from mailout-de.gmx.net ([213.165.64.23]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SCFbi-0008Rh-RB for pgsql-hackers@postgresql.org; Mon, 26 Mar 2012 19:29:35 +0000 Received: (qmail invoked by alias); 26 Mar 2012 19:29:20 -0000 Received: from a88-115-218-87.elisa-laajakaista.fi (EHLO [10.0.0.108]) [88.115.218.87] by mail.gmx.net (mp037) with SMTP; 26 Mar 2012 21:29:20 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX1+sgp9/ryysHgzLKFH1BQ1xT/05l70w6XZfZoyFaU 0tan16sZHdFiwr Message-ID: <1332790159.3800.8.camel@vanquo.pezone.net> Subject: Re: [COMMITTERS] pgsql: Remove dead assignment From: Peter Eisentraut To: Tom Lane Cc: pgsql-hackers@postgresql.org Date: Mon, 26 Mar 2012 22:29:19 +0300 In-Reply-To: <15768.1332789342@sss.pgh.pa.us> References: <15768.1332789342@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2-1 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/1579 X-Sequence-Number: 205461 On mån, 2012-03-26 at 15:15 -0400, Tom Lane wrote: > 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. Yes, but the return value is ignored in this case as well. Just assigning it doesn't change that. > I also do not think it does anything for readability for this call > of read_info() to be unexpectedly unlike all the others. I do not think that it is good code quality to assign something to a variable and then assign something different to a variable later in the same function. It is better, on the other hand, if a function call looks different if what it's supposed to do is different. But I don't want to get hung up on this. I thought it was just an oversight.