From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 13 03:59:22 2004 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51F4C16A4CE; Mon, 13 Sep 2004 03:59:22 +0000 (GMT) Received: from prg.traveller.cz (prg.traveller.cz [193.85.2.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2397B43D2F; Mon, 13 Sep 2004 03:59:21 +0000 (GMT) (envelope-from dan@obluda.cz) Received: from [10.11.0.2] (kulesh.obluda.cz [193.179.22.243]) by prg.traveller.cz (8.12.10/8.12.10/prg) with ESMTP id i8D3xHp5092241 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 13 Sep 2004 05:59:19 +0200 (CEST) Message-ID: <41451B14.5050103@obluda.cz> Date: Mon, 13 Sep 2004 05:59:16 +0200 From: Dan Lukes User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040817 X-Accept-Language: cs, sk, en MIME-Version: 1.0 To: Dima Dorfman References: <200409130100.i8D10xDG057337@freefall.freebsd.org> <20040913031253.GD42003@trit.org> In-Reply-To: <20040913031253.GD42003@trit.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit cc: freebsd-bugs@freebsd.org cc: keramida@freebsd.org Subject: Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 03:59:22 -0000 Dima Dorfman wrote: > Any initialization in the form "T v = v" invokes undefined behavior by > using the indeterminate value of an object. Eliminating a warning or Unless compiler documentation say other ... The v=v DURING DECLARATION (not later) is special case. Even on non GCC compiler it didn't make things worse - the value of v has not been changed by v=v statement ... > compiler can't be convinced that the variable is never used before > being initialized, please initialize it to something obviously bogus. It can be convicted, by "v=v" trick during declaration of variable. It's hack, of course. It seems to be similar to "declared but newer used" warning. It is eliminated by compiler specific hack also ("__unused")- not by true usage of variable. So my recommended way seems to be consistent with current code style with no unnecesarry impacts to final executed code (you know - we correct GCC's problem, not bug within the code) But I'm far away from pushing this way to eliminate warnings. It's no problem to initialise variable to constant for me (I hope those patches will not be rejected "because the initialisation is not necesarry as variable is properly initialised later") If you thing those patches can't be used (with or without corrections you recommended) then close the PR Thank you for your comment.