Date: Mon, 13 Sep 2004 05:59:16 +0200 From: Dan Lukes <dan@obluda.cz> To: Dima Dorfman <dd@freebsd.org> Cc: keramida@freebsd.org Subject: Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code Message-ID: <41451B14.5050103@obluda.cz> In-Reply-To: <20040913031253.GD42003@trit.org> References: <200409130100.i8D10xDG057337@freefall.freebsd.org> <20040913031253.GD42003@trit.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41451B14.5050103>