From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axi5D-0005g9-PT for qemu-devel@nongnu.org; Tue, 03 May 2016 17:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axi52-0006iT-4a for qemu-devel@nongnu.org; Tue, 03 May 2016 17:42:14 -0400 Received: from mail.weilnetz.de ([37.221.199.173]:55131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axi51-0006gP-V1 for qemu-devel@nongnu.org; Tue, 03 May 2016 17:42:08 -0400 References: <20160503155857.23801.56272.malonedeb@gac.canonical.com> <5728E9C4.4060706@weilnetz.de> <20160503211130.GA8896@aurel32.net> From: Stefan Weil Message-ID: <57291B23.1060602@weilnetz.de> Date: Tue, 3 May 2016 23:41:55 +0200 MIME-Version: 1.0 In-Reply-To: <20160503211130.GA8896@aurel32.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Bug 1577841] [NEW] target-mips/helper.c:542: bad sizeof ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Bug 1577841 <1577841@bugs.launchpad.net>, qemu-devel@nongnu.org Am 03.05.2016 um 23:11 schrieb Aurelien Jarno: > On 2016-05-03 20:11, Stefan Weil wrote: >> Am 03.05.2016 um 17:58 schrieb dcb: >>> Public bug reported: >>> >>> Recent versions of gcc say this: >>> >>> qemu/target-mips/helper.c:542:9: warning: =E2=80=98memset=E2=80=99 us= ed with length >>> equal to number of elements without multiplication by element size >>> [-Wmemset-elt-size] >>> >>> Source code is >>> >>> memset(env->CP0_WatchLo, 0, sizeof(*env->CP0_WatchLo)); >>> >>> Maybe better code >>> >>> memset(env->CP0_WatchLo, 0, 8 * sizeof(target_ulong)); >>> >>> ** Affects: qemu >>> Importance: Undecided >>> Status: New >> >> This might be an error. I think it should be >> >> memset(env->CP0_WatchLo, 0, sizeof(env->CP0_WatchLo)); >> >=20 > I confirm this is the correct version of the code. Someone is sending a > patch, i should I do that? >=20 > Aurelien Yes, that would be nice. I don't think the patch is needed for 2.6 as this code is rather old, so it is sufficient to fix it in the next versio= n. Thanks, Stefan