From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIpOM-0008Aq-2u for qemu-devel@nongnu.org; Sat, 07 May 2011 17:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIpOK-0007Lo-UA for qemu-devel@nongnu.org; Sat, 07 May 2011 17:50:26 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:41688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIpOK-0007Lk-R6 for qemu-devel@nongnu.org; Sat, 07 May 2011 17:50:24 -0400 Received: by iwl42 with SMTP id 42so4099703iwl.4 for ; Sat, 07 May 2011 14:50:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1304801048-26036-1-git-send-email-weil@mail.berlios.de> References: <1304801048-26036-1-git-send-email-weil@mail.berlios.de> Date: Sat, 7 May 2011 22:50:23 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] linux-user: Set uninitialized local variable and disable unused code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Riku Voipio , QEMU Developers On 7 May 2011 21:44, Stefan Weil wrote: > cppcheck report: > linux-user/signal.c:2057: error: Uninitialized variable: err > > cppcheck is correct. Setting err = 0 is a workaround to avoid > random results and the cppcheck warning. > > Function restore_fpu_state is currently unused, so I disabled the code. (This is in the SPARC-specific part of that file, to save other people having to dig through for the relevant ifdef; maybe we should split it up rather than having every target cpu have its own huge ifdef-guarded section...) I'm not sure there's much point in putting in the "err=0" change as well as ifdef'ing out the function, is there? The code is clearly broken and whoever fixes it will end up doing something similar then. Obviously it would be nicer to actually fix the code, since at the moment it means if your SPARC binary uses floating point in a signal handler it can trash registers. Luckily given where qemu takes guest signals it's quite hard to actually provoke visible problems with this. I'm surprised gcc doesn't complain about this. -- PMM