Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KusWm-00028L-0t for qemu-devel@nongnu.org; Tue, 28 Oct 2008 13:38:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KusWk-000262-Gu for qemu-devel@nongnu.org; Tue, 28 Oct 2008 13:38:47 -0400 Received: from [199.232.76.173] (port=58478 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KusWj-00025G-IR for qemu-devel@nongnu.org; Tue, 28 Oct 2008 13:38:45 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:38887) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KusWj-0003g4-8I for qemu-devel@nongnu.org; Tue, 28 Oct 2008 13:38:45 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate03.web.de (Postfix) with ESMTP id 88370F32AF0C for ; Tue, 28 Oct 2008 18:38:35 +0100 (CET) Received: from [82.113.106.1] (helo=[10.69.66.135]) by smtp07.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.109 #226) id 1KusWZ-0005TN-00 for qemu-devel@nongnu.org; Tue, 28 Oct 2008 18:38:35 +0100 Message-Id: <02F3A882-5122-4DA1-BEEC-37E92FA34ADE@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: <18695.17376.329419.634634@mariner.uk.xensource.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: [Qemu-devel] [5275] Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings Date: Tue, 28 Oct 2008 18:38:31 +0100 References: <18695.17376.329419.634634@mariner.uk.xensource.com> Sender: andreas.faerber@web.de 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 Am 28.10.2008 um 17:54 schrieb Ian Jackson: > Blue Swirl writes ("[Qemu-devel] [5275] Suppress gcc 4.x -Wpointer- > sign (included in -Wall) warnings"): >> - ret = sprintf(phys_ram_base + (16 << 20) - 256, >> + ret = sprintf((char *)(phys_ram_base + (16 << 20) - 256), > > I realise I'm a bit late with this comment (my apologies), but: > > I think this shows that it would be better to suppress the warning > with the appropriate compiler option, than to try to update the code. > > IMO the warning is a mistake since representational compatibility > between corresponding signed and unsigned types is certain for any > platform qemu could plausibily support. > > And these kind of casts are dangerous because they can suppress > serious warnings about pointer/integer mismatch. Not sure what type phys_ram_base had here, but char can be signed or unsigned depending on platform and this often leads to warnings on, e.g., OSX. Suppressing all signedness warnings could hide real mistakes, too... Andreas