From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JApBa-00025V-47 for qemu-devel@nongnu.org; Fri, 04 Jan 2008 11:14:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JApBX-00024z-HW for qemu-devel@nongnu.org; Fri, 04 Jan 2008 11:14:17 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JApBX-00024t-8a for qemu-devel@nongnu.org; Fri, 04 Jan 2008 11:14:15 -0500 Received: from relay01.mx.bawue.net ([193.7.176.67]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JApBW-000634-Rs for qemu-devel@nongnu.org; Fri, 04 Jan 2008 11:14:15 -0500 Date: Fri, 4 Jan 2008 16:14:15 +0000 From: Thiemo Seufer Subject: Re: [Qemu-devel] [PATCH] ensure all invocations to bdrv_{read, write} use (uint8_t *) for its third parameter Message-ID: <20080104161415.GC22809@networkno.de> References: <20080104081041.GB9968@tapir> <20080104132039.GA22809@networkno.de> <391FA8ED-AD24-4AFC-915E-5609235542F1@web.de> <20080104140030.GH5666@implementation.uk.xensource.com> <9C6EAA0B-8DBC-4871-AC1B-6E21B31E92FC@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <9C6EAA0B-8DBC-4871-AC1B-6E21B31E92FC@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: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org Andreas F=E4rber wrote: > > Am 04.01.2008 um 15:00 schrieb Samuel Thibault: > >> Andreas F=E4rber, le Fri 04 Jan 2008 14:41:29 +0100, a =E9crit : >>> >>> Am 04.01.2008 um 14:20 schrieb Thiemo Seufer: >>> >>>> Carlo Marcelo Arenas Belon wrote: >>>>> Trivial fix that ensures that all buffers used for bdrv_read or >>>>> bdrv_write >>>>> are from an array of the uint8_t type >>>> >>>> Do we have a host where this actually makes a difference? >>> >>> I believe Perl makes sizeof(char) checks, so there likely is some >>> platform where sizeof(char) > 1. >> >> The C standard says >> >> `When applied to an operand that has type char, unsigned char, or signed >> char, (or a qualified version thereof) the result is 1.' AFAIR this is C99 ... > The standard maybe. But Win64 violates the C standards, too. ;) > > According to our department's ANSI C course, the only consistent rule is > sizeof(char) <=3D sizeof(short) <=3D sizeof(int) <=3D sizeof(long) > without any concrete numbers. =2E.. and this is C89. Thiemo