From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iy6bV-0006Zs-M4 for qemu-devel@nongnu.org; Fri, 30 Nov 2007 09:12:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iy6bT-0006Yo-VL for qemu-devel@nongnu.org; Fri, 30 Nov 2007 09:12:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy6bT-0006Yj-Mx for qemu-devel@nongnu.org; Fri, 30 Nov 2007 09:12:27 -0500 Received: from outbound-blu.frontbridge.com ([65.55.251.16] helo=outbound3-blu-R.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Iy6bT-0001Am-4r for qemu-devel@nongnu.org; Fri, 30 Nov 2007 09:12:27 -0500 Received: from outbound3-blu.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound3-blu-R.bigfish.com (Postfix) with ESMTP id 2CD31CC2F08 for ; Fri, 30 Nov 2007 14:12:24 +0000 (UTC) Received: from mail183-blu-R.bigfish.com (unknown [10.1.252.3]) by outbound3-blu.bigfish.com (Postfix) with ESMTP id 10411156004F for ; Fri, 30 Nov 2007 14:12:24 +0000 (UTC) Received: from mail183-blu (localhost.localdomain [127.0.0.1]) by mail183-blu-R.bigfish.com (Postfix) with ESMTP id BF27A1B0254 for ; Fri, 30 Nov 2007 14:12:23 +0000 (UTC) Received: from ausb3extmailp02.amd.com (rebel3.amd.com [163.181.251.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail183-blu.bigfish.com (Postfix) with ESMTP id C6C96720053 for ; Fri, 30 Nov 2007 14:12:20 +0000 (UTC) Received: from SAUSGW02.amd.com (sausgw02.amd.com [163.181.250.22]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id lAUECGSq032536 for ; Fri, 30 Nov 2007 08:12:19 -0600 Message-ID: <475019BF.4040906@amd.com> Date: Fri, 30 Nov 2007 15:10:07 +0100 From: "Andre Przywara" MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] fix gcc4 compile warnings References: <474F5223.1000202@andrep.de> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Andrzej, > These casts are not the right way to get rid of the warnings, as are > some of the casts in other files in qemu_put_* and qemu_get_* > arguments. In this case the warnings are true positives and the bugs > causing the warnings have to be addressed instead of just the > warnings. Are you sure of that? Most of the fixes are like this: >> - qemu_put_be32s(f, &s->count_shift); >> + qemu_put_be32s(f, (uint32_t *)&s->count_shift); qemu_put_be32s is (QEMUFile *f, const uint32_t *pv), but after all the 2nd argument is only a _pointer_ to an unsigned variable, the size is the same (thanks to the C99 explicit types). Qemu will dump this value straight into a file, in this case signedness does not matter as long as put and get use the same. The more cleaner solution would be to introduce an explicitly signed prototype for qemu_put_* and qemu_get_* and use this where applicable, if you want I will prepare a patch for this. If you want some real fix, I can dig deeper and make more changes (especially the uint8_t vs. char problem), but I wanted to start slowly and don't change much code in the first effort. What solution do you prefer for the opaque types? I have used the simple: >> - void *args[MAX_ARGS]; >> + intptr_t args[MAX_ARGS]; A more portable and clean solution would be this: - void *args[MAX_ARGS]; + union + { + void* ptr; + int i; + } args[MAX_ARGS]; If you prefer this, I can change the patch accordingly. > I will try to do this and apply other parts of your patch > when I find a bit of time. Thanks for that, if I can help you with some boring work, tell me ;-) Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 277-84917 ----to satisfy European Law for business letters: AMD Saxony Limited Liability Company & Co. KG, Wilschdorfer Landstr. 101, 01109 Dresden, Germany Register Court Dresden: HRA 4896, General Partner authorized to represent: AMD Saxony LLC (Wilmington, Delaware, US) General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy